简体   繁体   中英

Scaling android app to different screen sizes

So I'm working on scaling my application to different screen sizes. Right now Its optimized for a 10.1 inch screen but I'm working to get it to run on the kindle fire which has a 7 inch screen. I'm only using relative layouts. As of now my background scales perfectly but the image buttons ontop of the background don't scale and I was wondering if there was a reason for this. Also I use margins to adjust the positions of my buttons, is this okay for scaling sizes?

to support application on different screen refer the following link

http://developer.android.com/guide/practices/screens_support.html

and to scale image button use nine patch images they scale well.

Also I use margins to adjust the positions of my buttons, is this okay for scaling sizes?

yes it okay.

You should always define in your manifest because the default values can change from one version to another.

But if you want to support xlarge screens then you're stuck because this attribute was introduced in API level 9 (android 2.3). You have to create two different APKs, one for android versions >= 2.3 and the other for the older ones.

Since it's a common issue, android provides a nice way to publish only one application on the market even if you use multiple APKs.

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