Android 滑动窗格布置滑动窗格悬挑主窗格

Android 滑动窗格布置滑动窗格悬挑主窗格,android,android-layout,android-fragments,android-sliding,Android,Android Layout,Android Fragments,Android Sliding,嗨,我正在构建一个地图应用程序,并试图拥有它,所以当你点击一个生成器时,它会打开滑动窗格。它的工作方式正是我想要的,但当窗格关闭时,你仍然可以看到它有一点悬垂。我想把它隐藏在屏幕外,这样你所看到的就是地图片段 activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schema

嗨,我正在构建一个地图应用程序,并试图拥有它,所以当你点击一个生成器时,它会打开滑动窗格。它的工作方式正是我想要的,但当窗格关闭时,你仍然可以看到它有一点悬垂。我想把它隐藏在屏幕外,这样你所看到的就是地图片段

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.SlidingPaneLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/sliding_layout"
    android:layout_width="fill_parent"
    android:layout_height="match_parent" >

<fragment
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/map"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"    
    android:layout_margin="0dp"

    class="com.google.android.gms.maps.SupportMapFragment" />

     <fragment
        android:id="@+id/photo"
        android:name="com.example.mapapp.SliderFragment"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:layout_margin="0dp"  />

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

请参见下图


我知道这是一个非常晚的答案,您可能已经找到了一个解决方案,但您想要的功能在我听来就像一个抽屉布局。您可以从以下官方Android文档中了解更多关于如何实现该功能的信息:


我试图发布一个截图,但没有代表:(将图像添加到此网站并添加链接