// mMinWidth 对应与android:minWidth 这个属性所指定的值,这个属性如果不指定,//  那么mMinWidth 则默认为0    protected int getSuggestedMinimumWidth() {        return (mBackground == null) ? mMinWidth :                 max(mMinWidth, mBackground.getMinimumWidth());    }

可以看到mBackground  == null 为没有设置背景,那么返回mMinWidth ,也就是android:minWidth 这个属性所指定的值,这个值可以是0 ;如果View 设置了背景,则返回mMinWidth 与背景的最小宽度这两者的最大值。

getSuggestedMinimumWidth() 的返回值就是View 在UNSPECIFIED 情况下的测量宽。

更多相关文章

  1. Android布局属性一览表
  2. android布局属性详解分享
  3. Android控件属性手册
  4. RelativeLayout用到的一些重要的属性:
  5. Android自定义dialog以及如何去除黑色背景
  6. 设置listview的背景颜色
  7. linearlayout属性

随机推荐

  1. 一分钟解决Shape分割线及分割线圆角框
  2. android沉浸式状态栏和状态栏字体设置工
  3. android in practice_Threads and concur
  4. Why your Android(安卓)Apps Suck
  5. Google cardBoard Android(安卓)API (十
  6. Android(安卓)控件GridView的使用
  7. Android(安卓)Call disconnected reason
  8. 关于安卓广播无法启动接收器的问题
  9. Android底层知识Window和WindowManager深
  10. okhttp http 重定向到https