android - Unit for Layout on tablet and smartphone -


i want develop app smartphones , tablets. problem layout isn't scalled in right dimensens. on 10' tablet looks this:

10' tablet

but here screenshoots 7' tablet , smartphone:

7' tablet

smartphone

i set min width , height imageview , scale , down depending on screen size in each layout listview visible. unit have use imageview width , height? tried dp, in , more not help...

use

<imageview     android:layout_width="@dimen/imageviewwidth"     android:layout_height="@dimen/imagevewheight"     android:scaletype="fitxy" /> 

scaletype="fitxy" scale image , fit imageview width , height. solve problem.

edit

in values directory, open strings.xml file, add following lines

<dimen name="imageviewwidth">30dp</dimen> <dimen name="imageviewheight">30dp</dimen> 

now, open values-sw600dp directory (of not, create one) , open strings.xml file (if not, copy other values directory).

<dimen name="imageviewwidth">100dp</dimen> <dimen name="imageviewheight">100dp</dimen> 

now, open values-sw720dp directory (of not, create one) , open strings.xml file (if not, copy other values directory).

<dimen name="imageviewwidth">120dp</dimen> <dimen name="imageviewheight">120dp</dimen> 

this solve problem of different sizes of imageview different layouts.

still can't understand, read answer at


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -