【问题标题】:SlidingPaneLayout slide pane overhanging main paneSlidingPaneLayout 滑动窗格悬垂主窗格
【发布时间】:2015-09-06 21:34:09
【问题描述】:

您好,我正在构建一个地图应用程序并尝试使用它,因此当您点击制造商时,它会打开滑动窗格。它按我想要的方式工作,但是当窗格关闭时,您仍然可以看到它有点悬垂。我想把它隐藏在屏幕之外,所以你看到的只是地图片段。

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 android-layout android-fragments android-sliding


【解决方案1】:

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

https://developer.android.com/training/implementing-navigation/nav-drawer.html https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-26
    相关资源
    最近更新 更多