Reputation: 199
I already read the entire android documentation about this and i still didnt manage to do this in the right way.
I will explain better.
I have 3 different devices, a 480x320 a 640x480 and the 800x480. The problem is that these 3 devices uses my normal layout, in other words only one of them will fit okay.
I am already using dp instead of px and i have all sized of images for all kinds of screens densities but the problem is that i make a lot of layouts with margin and spaces between the views so when i put in the 800x400 phone it lays perfectly but in the others a large piece of the screen is like cutted...
I searched for this and i really dont know what to do, i need a way to manage all the screen sizes in this same project.
Please does anyone has any idea how to make this right?
Upvotes: 0
Views: 1120
Reputation: 11807
dp
value for some text size - use a <dimen>
resource to define different size for different screens (same resource placed in multiple values-...
folders)gravity
attribute use layout_weight
in your layout to let it's children occupy fixed % of the layout's spaceEDIT: You have written that you've read the documentation but I'd like to mention that Providing Resources and Supporting Multiple Screens are the absolute minimum in my opinion. Don't forget their "Best practices" sections too.
Upvotes: 0
Reputation: 143
To manage your layout effectively follow following guidelines.
1). Always try to use RelativeLayout in your XML as RelativeLayout adjust views according to your screen size.
2). Instead of creating Layouts for all size screen try to use Dimensions for all screen size and create single Layout.(Creating Dimension will reduce you lots of work and effort)
Upvotes: 1