【问题标题】:How can i limit the size of a sliding drawer? [duplicate]如何限制滑动抽屉的尺寸? [复制]
【发布时间】:2011-03-11 21:48:17
【问题描述】:

可能重复:
Android: can height of SlidingDrawer be set with wrap_content?

有没有办法改变滑动抽屉打开时的大小?有没有办法将它放在顶部或左侧,因为默认选项是垂直方向的底部和水平方向的右侧。

【问题讨论】:

    标签: android size position slidingdrawer


    【解决方案1】:

    This answer 关于覆盖 SlidingDrawer#onMeasure 以启用 wrap_contentSlidingDrawer 似乎是一个胜利者。

    onMeasure() 方法 SlidingDrawer 基本上上课 覆盖布局模式 fill_parent,这就是为什么 layout_height="wrap_content" 不是 工作。

    编辑 - 或者,您可以使用 layout_height="200dp" 之类的内容精确设置高度。

    您的另一个问题已经是answered in the negative

    【讨论】:

    • 但我想的更像是link
    • 当然,这看起来也是个好主意。您只需在 SlidingDrawer 上设置精确的 layout_height 即可轻松尝试
    • 问题是我的线性布局没有重力 android:gravity="bottom" 。
    猜你喜欢
    • 2021-04-24
    • 2020-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-12
    相关资源
    最近更新 更多