Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.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_Slidingpanelayout - Fatal编程技术网

Android 无法将滑动面板布局设置为不可见

Android 无法将滑动面板布局设置为不可见,android,slidingpanelayout,Android,Slidingpanelayout,我正在尝试创建一个在滑动窗格中包含MapFragment的应用程序。地图位于一个片段上,该片段滑入主内容列表视图。但是,我无法完全隐藏MapFragment,因为它的一部分在主视图中始终可见。 这是我的密码 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"

我正在尝试创建一个在滑动窗格中包含MapFragment的应用程序。地图位于一个片段上,该片段滑入主内容列表视图。但是,我无法完全隐藏MapFragment,因为它的一部分在主视图中始终可见。 这是我的密码

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:id="@+id/LinearLayout1"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical"
                tools:context=".MainActivity" >

    <android.support.v4.widget.SlidingPaneLayout
            android:id="@+id/sliding_layout"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">


        <ListView
                android:id="@+id/postsView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="left"
                >
        </ListView>


            <fragment
                    android:id="@+id/map"
                    android:name="com.google.android.gms.maps.SupportMapFragment"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="right"

                    />


    </android.support.v4.widget.SlidingPaneLayout>

</LinearLayout>


这就是滑动面板布局的本质。它总是显示相反窗格的一部分,以帮助指示用户如何在窗格之间切换。我在其API中看不到任何改变这一点的选项,尽管有可能通过样式实现这一点。

谢谢您的回答,有没有这样的样式示例,你可以给我指哪一个?我已经看到谷歌+安卓应用程序正在运行so@tinker:您有什么证据表明Google+应用程序正在使用
滑动面板布局
?好吧,他们使用的是
DrawerLayout
(或者他们自己的作品),这是一个完全不同的东西(尽管有一些UI相似之处)。