在我的主布局文件中,我陈述了以下内容:
android:padding="10dp"在我的代码中,我说:
int padding = getPaddingLeft();如果我在Eclipse中调试代码,padding将等于整数值20。
这是否意味着要以整数格式表示dp,我们需要将其乘以2?
发布于 2014-05-26 02:18:22
不,该方法返回像素值
public int getPaddingLeft ()
Added in API level 1
Returns the left padding of this view. If there are inset and enabled scrollbars, this value may include the space required to display the scrollbars as well.
Returns
the left padding in pixelsSource
这意味着您当前使用的设备是xhdpi设备。
https://stackoverflow.com/questions/23858467
复制相似问题