安卓中
TypedArray attributes;
attributes.getDimension(R.styleable.style, height);这个方法里面的height 是通过手机分辨率转化而来 是px值。如果在xml中传入的是dp值 系统会自动转化成对应的px值然后传入height。个人理解。理解错误请及时指正 3q.