Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想手动设置 ImageView 的大小。ImageView 对于所有视图都有一个函数setMinimumHeight。我告诉 ImageView 把它放在什么单位?
您正在获取并设置以像素为单位的大小。当minWidth属性从 XML 膨胀时,它会从其维度转换为像素测量值:
minWidth
来自 View.java:
case R.styleable.View_minWidth: mMinWidth = a.getDimensionPixelSize(attr, 0);