首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >阻止SlidingPaneLayout走得太远

阻止SlidingPaneLayout走得太远
EN

Stack Overflow用户
提问于 2014-02-05 14:11:07
回答 1查看 242关注 0票数 0

我在左侧窗格中有一个包含片段的SlidingPaneLayout。

代码语言:javascript
复制
<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%的右侧窗格,即我希望滑动运动停止得更快。

EN

回答 1

Stack Overflow用户

发布于 2015-06-21 15:19:26

这个问题可以通过在xml的片段标签中设置"android:layout_marginLeft“来解决,希望它能对你有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21569865

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档