简体   繁体   中英

Design images, buttons, text, etc to fit all screen sizes for android tablet in landscape mode

I am a bit confused about resolution of Android Tablets. Each Tablet has different resolution and size. How can I design images, logos, buttons, etc to fit all android Tablet size in Landscape mode.

You need to make the images for only one size (or for one device).
Lets say you are working on a tablet with screen size 640x960.
You can then make a layer of size 640x960 and add the images to that layer.
Once you have your layer with all the images you want on it, you must then scale that layer up or down depending on the device screen.

So if you made an image for a device with screen pixels: 640 x 960, and you test it on a different device with screen size 400 x 800, you would then scale the layer that contains your images like so:

layer->setScaleX(640/400);
layer->setScaleY(960/800);

And the layer will stretch inwards to fit the smaller screen.

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