我有三個垂直排列的控件,列表視圖,菜單按鈕和隱藏菜單。 列表視圖將佔據整個屏幕並且菜單按鈕將被粘貼到屏幕的底部。當我們觸摸菜單按鈕時,隱藏菜單將向上滑動並佔據近一半的屏幕。隱藏菜單不會覆蓋整個屏幕。如何安排佈局和哪些佈局用於FB菜單效果
我可以使用哪些佈局以及如何安排?
增加了額外信息。
下面是我測試的xml佈局。如果我發送了屏幕外我的子菜單,列表數據未加載,我認爲這是因爲它沒有顯示在屏幕上。
<RelativeLayout
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/header_layout"
android:background="#ffffff" >
<ExpandableListView
android:id="@+id/listview_Category"
android:layout_width="match_parent"
android:layout_height="500dp"
android:divider="#E5E5E5"
android:dividerHeight="1dp"
android:background="#aaaaaa"
tools:listitem="@layout/list_item"
>
</ExpandableListView>
<ImageButton
android:id="@+id/imageButtonMenu"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/app_name"
android:src="@drawable/menu_icon" />
<ListView
android:id="@+id/listview_Cat"
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_toEndOf="@+id/imageButtonMenu"
android:background="#777777"
android:divider="#ffffff"
android:dividerHeight="1dp"
android:translationY="500dp"
tools:listitem="@layout/category_list_item" >
</ListView>
</RelativeLayout>
use this https://github.com/i8ramin/fb-menu –
試試這個:http://stackoverflow.com/questions/16338647/framelayout-is-it-possible-to-put-child-layout- off-screen –