Android 如何通过水平滑动隐藏像导航抽屉一样的碎片?
有一个列表视图被swiperefresh布局包装在片段中, 我想把它隐藏在屏幕右角的边界之外 我无法使用抽屉布局,因为我不想选择项目 我的片段:Android 如何通过水平滑动隐藏像导航抽屉一样的碎片?,android,xml,fragment,swipe,Android,Xml,Fragment,Swipe,有一个列表视图被swiperefresh布局包装在片段中, 我想把它隐藏在屏幕右角的边界之外 我无法使用抽屉布局,因为我不想选择项目 我的片段: <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/refre
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:context="com.example.nick.music365.gui.fragments.ListFragment">
<ListView
android:id="@+id/list_view"
android:layout_width="@dimen/listview_width"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:divider="@null"
android:dividerHeight="0dp" />
您可以将片段设置为抽屉并从右向左滑动。您也可以省略ActionBarTogle部分,不在顶部显示图标,您不需要在抽屉中选择任何东西!它只是一个片段或视图的占位符在我的活动布局中我有3个片段,我没有要替换内容的框架布局