我在左侧窗格中有一个包含片段的SlidingPaneLayout。
<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>片段不是很宽,但它的宽度可能会有一些变化,因为它由动态加载的微调器组成。
如何让SlidingPaneLayout在显示完整片段后停止打开?
说明:在面板滑出之前,我可以看到整个右侧(或xml中的底部)窗格,左侧窗格是隐藏的。
滑动后,我可以看到大约10%的右侧窗格在向右移动时,以及90%的左侧窗格。
我希望看到的是30%的左侧窗格和60%的右侧窗格,即我希望滑动运动停止得更快。
发布于 2015-06-21 15:19:26
这个问题可以通过在xml的片段标签中设置"android:layout_marginLeft“来解决,希望它能对你有所帮助。
https://stackoverflow.com/questions/21569865
复制相似问题