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