摘要: 我们知道谷歌的自适应做的还是非常不错的,不过有时候,我们单纯的靠在xml中写"xxxdp"可能并不能满足我们的编码需求,因为在代码中设置宽高等值基本都是用的px,因此提供一个dp和px的转换方法,供大家使用,此方法源于网络(http://blog.csdn.net/arui319)。import android.content.Context; public class DensityUtil { /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context conte... 阅读全文
posted @ 2013-05-02 10:08 cooosuper 阅读(98) 评论(0) 推荐(0)