我不知道该怎么做?我想在另一个布局的底部有一个静态视图,用户可以向上滑动以显示另一个视图.我不确定这个功能是什么,但我知道Facebook应用程序会这样做,ESPN和Google plus也是如此.谢谢!
最简单的方法是使用SlidingDrawer.
只要您想从底部(或右侧)向上滑动,这将非常有效.如果您想从顶部或从左侧向下滑动某些内容,则无效.
要使用它,您只需在XML布局中使用以下内容:
<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:handle="@+id/handle"
android:content="@+id/content">
<ImageView
android:id="@id/handle"
android:layout_width="88dip"
android:layout_height="44dip" />
<GridView
android:id="@id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</SlidingDrawer>
Run Code Online (Sandbox Code Playgroud)
ImageView是"句柄"(你上下拉动打开抽屉的东西),而GridView是你想要抽屉容纳的任何内容(它可以是任何类型的视图,而不仅仅是GridView).
| 归档时间: |
|
| 查看次数: |
1960 次 |
| 最近记录: |