我有一个 SlidingPaneLayout,左窗格中有一个 ListView,右窗格中有一个 MapFragment。
她是我的代码:
<?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_pane_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView android:id="@+id/left_pane"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="left"/>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_height="match_parent"
android:layout_width="300dp"
android:layout_weight="1"
android:name="com.google.android.gms.maps.MapFragment"/>
</android.support.v4.widget.SlidingPaneLayout>
问题是当 SlidingPaneLayout 显示在小屏幕上时(在我的情况下小于 200dp + 300dp)。然后直到右窗格完全显示在屏幕上才能看到地图。即使左窗格在屏幕上(在 ListView 右侧可见),我也希望地图可见。
不是这样的。我希望右窗格显示地图。
有可能吗,怎么做?