Multiple Screen Size support for android? -
Multiple Screen Size support for android? -
i creating simple layout
in android customized buttons(not ones android provides default).the image appears proper on screen size 2.7 5.1. buttons
appear stretched on screen size 5.4 , greater (tried till screen size 7).i have made 4 same images named them of different densities , placed them correspondingly in folders ldpi,mdpi,hdpi,xhpi
.i need know whether need create different layouts
different screens?or android picks images automatically corresponding folders?some body please guide me new android on struggling create layouts
targeting android mobile devices.
no need of defining different layout
folders(layout-land
, layout-large
, layout-small
) if u designed layouts consistently. android os
take care of that(regarding images
display). thing have add together <support-screens>
in manifest
, below <support-screens>
:
<supports-screens android:resizeable=["true"| "false"] android:smallscreens=["true" | "false"] android:normalscreens=["true" | "false"] android:largescreens=["true" | "false"] android:xlargescreens=["true" | "false"] android:anydensity=["true" | "false"] android:compatiblewidthlimitdp="integer" android:largestwidthlimitdp="integer"/>
tips creating consistent layouts:
dont hard-codelayout
parameters such width
,height
,etc.. dont utilize "px
".use "sp
" text size , "dp
" layout-width
, layout-height
etc. make utilize of relativelayout
, linearlayout
, dont utilize absolutelayout
deprecated. use scrollview
wherever required layouts
supports singleview. for more info check android developer documents of support multiple screens.
android
Comments
Post a Comment