質問

I'm working on the layout of an android application. But I have a question about the layout. Once i have created a layout and then go to another screen (for instance 4 inches to 5 inches) all my buttons and text boxes are messed up.. Is there a method to make everything static, so that my layout works on every mobile phone..

役に立ちましたか?

解決

What kind of layout are you using, could it be RelativeLayout? that might be your problem in this particular instance.

Anyway, in android there are many screen sizes, each of them you should handle with different layouts depending on orientation, size and density. There is no magic formula as far as I know, but 9-patch images can help a lot. Another thing you should do is make sure that you understand how match_parent and wrap_content values work for height and width.

Check this out: Suppoting different screens

他のヒント

You have to create folders for different types of screens take a look at android developers training

This document contains everything you need.

Instead of having everything fixed, it shows how to design a layer that adapts to the various screens you may encounter.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top