Android 如何在代码中将PX转换成DIP
摘要://px转换成dip public int dip2px(Context context, float dipValue){ final float scale = context.getResources().getDisplayMetrics().density; return (int)(dipValue * scale + 0.5f); } 下面是如何调用:a1.setPadding(a1.getPaddingLeft()+this.dip2px(this, 5...
阅读全文
posted @
2011-10-09 11:40
QZB
阅读(579)
推荐(1)