简体   繁体   中英

different devices with different image and font size

I am creating an app for different devices and I added images with different sizes in drawable-small, drawable-medium... to add the same image for different devices but I need to increase the size of the image when the size of the screen increases is this the correct way? plus I need to increase the font size when the screen size increases how can I do that and if I used the layout-small... folders what font size will be the perfect size for the devices with small screen size (portrait and landscape) and for the medium and large..?where can I find this info as I am trying and trying different font sizes but there must be another way!! thanks.

This is a very rookie question but here goes:

You set the text and image sized in dp (density pixels) so screen size and resolution is irrelevant.

As for making multiple drawables for each screen size is a good idea but not a necessity since you can choose how much of the screen each picture will take, but on bigger screens make sure the resolution of your images are high enough to look good.

For scaling a particular image to all screen size you can use nine patch image. There will be drawninepatch.bat file in the tools folder of your sdk. Open that , drag and drop the image , and you want to expand the image based on your needs. Now after the nine patch is created put that in the drawable folder. This image will expand accordingto the screen resolution and densities.

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