dip转px

 

1
2
3
4
5
6
private int getPixels(int dipValue){
    Resources r = getResources();
    int px = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dipValue,
        r.getDisplayMetrics());
    return px;
}
posted @ 2013-01-05 10:54  Hecker385  阅读(156)  评论(0编辑  收藏  举报