11. dp 的意義:
A virtual pixel unit that you should use when
defining UI layout, to express layout dimensions or
position in a density-independent way.
dp 與實際像素的轉換
px = dp * (dpi / 160)
其中 dpi 為此種螢幕的 Density
資料來源:
http://developer.android.com/guide/practices/screens_support.html
12. 討論:為何 Android 推薦用 dp 為單位?
Skin Res Density(dpi) dp px
QVGA 240 x 320 120(Low) 300dp 225px
HVGA 320 x 480 160(Medium) 300dp 300px
WQVGA400 240 x 400 120(Low) 300dp 225px
WVGA800 480 x 800 240(High) 300dp 450px
注意比例關係