简体   繁体   中英

Fit in different Screen sizes

I'd like to make a program in android that contains a image of text. I load it as a background for my screen but when I choose to preview all screens in the Eclipse Editor I see the image's text misaligned. How can I build a application that I have to use image instead of programmatically drawing text in code that fits all screen sizes.

You should take a look at http://developer.android.com/guide/practices/screens_support.html . You can create different layout folders, each containing the same name layout files. For instances, I use the standard layout folder for phones, layout-sw600p for 7in tablets and layout-sw700dp for 10in tablets. I can create a layout such as main.xml in each of those folders and adjust for for each size accordingly. Android will automatically pick the appropriate file for the folder based on what device you are on.

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