简体   繁体   中英

Android: Image button size for multiple screen sizes but with same density

I am writing an Android app to have a matrix of image buttons. I tested it with 2 devices: Galaxy Note 1 (5.3") and Galaxy tab 8.0 (8.00 "). When the source images are put in different density drawable folders, both devices took the images from hdpi folder. However the screen sizes are different. Buttons displayed correctly on tab 8.0 but too big on Note 1 (buttons are not all shown).

In this case, what is a better approach for this. Thx a lot.

Galaxy tab 8 is kind of tablets & its density as Galaxy Note one so you should put Galaxy tab image in

// for Phones drawable-ldpi drawable-mdpi drawable-hdpi

//for 7 inch tablets drawable-large-mdpi drawable-large-hdpi(for Nexus 7)

// for 10 inch tablets drawable-xlarge-mdpi

reference : this answer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM