2011年7月31日 星期日

[Android] Multiple screens layout size unit

Resolution is the actual number of pixels available in the display.

Density is how many pixels appear within a constant area of the display, and size is the amount of physical space available for displaying your interface.


* sp (scale-independent pixel)
  • To define text sizes.
  • Depends on a user setting and the system scales the size the same as it does for dp.

* dp
  • To remove the size/density calculations from the picture and should use dp for layout dimensions 
  • Because that the system(Android famework) can adjust dp units for screen density.


* Reference
- Supporting Multiple Screens | Android Developers
- Android Developers Blog: New Tools For Managing Screen Sizes

沒有留言:

張貼留言