user interface - Android UI design: multiple icon sizes for multiple screen sizes -


i'm using xamarin , visual studio 2012 developing application. have main menu screen contains 5 image views. have created following folders in resources folder: drawable-mdpi, drawable-hdpi, drawable-xhdpi , drawable-xxhdpi , created 4 sets of icons these drawables proper sizes. when test application on nexus 7, icons sizes same on nexus 4. added these lines manifest file:

    <compatible-screens>     <!-- small size screens -->     <screen android:screensize="small" android:screendensity="mdpi" />     <screen android:screensize="small" android:screendensity="hdpi" />     <screen android:screensize="small" android:screendensity="xhdpi" />     <!-- normal size screens -->     <screen android:screensize="normal" android:screendensity="mdpi" />     <screen android:screensize="normal" android:screendensity="hdpi" />     <screen android:screensize="normal" android:screendensity="xhdpi" />     <!-- large size screens -->     <screen android:screensize="large" android:screendensity="mdpi" />     <screen android:screensize="large" android:screendensity="hdpi" />     <screen android:screensize="large" android:screendensity="xhdpi" /> </compatible-screens> 

if have given icon size in density-independent pixels (dp) can see icon in same size across devices.

from code instructing device should support small, normal , large screens mdpi, hdpi , xhdpi densities. not relevant question.

nexus 4 , nexus 7 both fall under category xhdpi, both pick icons form drawable-xhdpi folder. yo see icons same size in both devices if have given icon size in dp.

if want create different sizes of icons normal , large devices, create separate layouts has different icon sizes in

res/layout res/layout-large 

folders

refereces:


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -