Android 停止滑动面板布局,以免走得太远
我有一个滑动面板布局,它在左侧窗格中包含一个片段Android 停止滑动面板布局,以免走得太远,android,android-layout,layout,android-sliding,Android,Android Layout,Layout,Android Sliding,我有一个滑动面板布局,它在左侧窗格中包含一个片段 <android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="
<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity$DummySectionFragment"
>
<fragment
android:name="com.bolldorf.cnpmoebel.widgets.PlaceChooserFragment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/fragment_place_chooser"
tools:layout="@layout/fragment_place_chooser"
android:layout_weight="0.3" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
< ... more stuff here ... >
</RelativeLayout>
</android.support.v4.widget.SlidingPaneLayout>
< ... 这里有更多东西…>
片段不是很宽,但是它的宽度可以稍微改变,因为它由动态加载的微调器组成
我如何让滑动面板布局在显示完整片段后停止打开
澄清:在面板滑出之前,我可以看到整个右侧(或xml中的底部)窗格,而左侧窗格是隐藏的
滑动后,我可以看到右侧窗格向右移动时的10%,以及左侧窗格的90%
<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity$DummySectionFragment"
>
<fragment
android:name="com.bolldorf.cnpmoebel.widgets.PlaceChooserFragment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/fragment_place_chooser"
tools:layout="@layout/fragment_place_chooser"
android:layout_weight="0.3" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
< ... more stuff here ... >
</RelativeLayout>
</android.support.v4.widget.SlidingPaneLayout>
我希望看到30%的左侧窗格和60%的右侧窗格,即我希望幻灯片移动更快停止。这可以通过在xml的片段标记中设置“android:layout\u marginLeft”来解决,希望这对您有所帮助。
你能把你的问题说清楚一点吗?