user interface - Android Tablet "dp" difference -


i create adaptive ui both mobile , tablet devices. know example mobile devices if give android:textsize="2dp how should give tablet devices. know should give them in values-w820dp , appropriate folder how calculate difference of dp. couldn't find resource this. me out.

(1) text, it's best size in sp units scales automatically relative user's text-size preference. folks lesser vision can pick larger text , able read app without eyestrain.

(2) if need text appear in fixed size, e.g. big headline, use dp units scales automatically relative screen's pixel density. (pixel density independent of overall screen size. it's high vs. low density thing, not phone vs. tablet thing.)

but don't use size 2dp! that'd unreadably tiny -- height of 2 physical pixels of 160 dpi screen.

(3) if need text uses approximately fixed proportion of screen size, makes sense either define screen-size-dependent parameters, e.g. in values-w820dp, or size in code.

(4) if need text in fixed number of pixels tall when pixels tiny, e.g. draw raster image, use px units.

see supporting multiple screens - best practices.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -