Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何通过水平滑动隐藏像导航抽屉一样的碎片?_Android_Xml_Fragment_Swipe - Fatal编程技术网

Android 如何通过水平滑动隐藏像导航抽屉一样的碎片?

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

有一个列表视图被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/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个片段,我没有要替换内容的框架布局