【问题标题】:How to arrange Layout and which layouts to use for FB menu like effect如何安排布局以及用于 FB 菜单效果的布局
【发布时间】:2013-07-23 17:26:57
【问题描述】:

我有三个垂直排列的控件,列表视图、菜单按钮和隐藏菜单。 列表视图将占据整个屏幕,菜单按钮将粘在屏幕底部。当我们触摸菜单按钮时,隐藏的菜单会向上滑动并占据几乎一半的屏幕。隐藏菜单不会覆盖整个屏幕。

我可以使用哪些布局以及如何排列?

添加了额外信息。

下面是我的测试 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>

【问题讨论】:

标签: android android-layout


【解决方案1】:

您可以使用框架布局,其中列表视图覆盖整个布局,菜单按钮底部对齐,菜单具有固定的宽度和高度...

但由于您要查找的是滑动菜单,您也可以使用最新版本的android中引入的导航抽屉

【讨论】:

  • 下面是我的示例 xml 布局,,,“listview_Cat”是隐藏菜单。当我将其位置设置为关闭屏幕时,不会加载列表数据。例如toEndOf.
猜你喜欢
  • 1970-01-01
  • 2016-11-29
  • 1970-01-01
  • 2013-12-04
  • 2012-09-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-15
相关资源
最近更新 更多