【问题标题】:Android: android:layout_width=wrap_content but not less than X dp?Android: android:layout_width=wrap_content 但不小于 X dp?
【发布时间】:2011-10-14 14:28:39
【问题描述】:

是否可以将 GUI 元素宽度定义为 android:layout_width="wrap_content",但以某种方式定义 Xdp 的最小宽度?

【问题讨论】:

    标签: android user-interface layout android-layout android-gui


    【解决方案1】:

    我相信您正在寻找的属性是android:minWidth。例如,

    android:minWidth="10dp"
    

    【讨论】:

      【解决方案2】:

      你可以使用:

      android:minHeight="20dp"
      android:minWidth="20dp"
      

      在你的 xml 布局中

      20dp 是一个样本值

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-02
        • 1970-01-01
        • 2014-10-03
        • 1970-01-01
        相关资源
        最近更新 更多