0

I have a project I am working on where the UI I have developed looks great on a 7" tablet, but the moment I try to use the app on a 10" tablet there is a lot of extra space to the right and bottom of my UI elements. Is there a way to scale UI elements to be bigger based on the size of the screen?

I need the UI to look exactly the same on every resolution possible. It should be noted that I am restricted to Eclipse and am programming on an older version of Android because the utilities I have been supplied with are older utilities.

Wish I could supply a screenshot, but I 100% cannot.

Joshua Blevins
  • 689
  • 1
  • 10
  • 27

1 Answers1

0

You can use different layouts for different screen sizes. layout-sw600dp ( for 7 inch tablets) layout-sw720dp ( for 10 inch tablets)

The system will automatically pick the layout per current device size. Just make sure to have the same layout name and id of the components in the layouts or it might cause exceptions if mismatch is found.

If you want completely different layouts for different sizes ( file names still have to be the same ), you can determine which kind of device it is, you can follow the description in the following's accepted answer.

Determine if the device is a smartphone or tablet?

Now using the above method, you can find appropriate views using IDs or whatever way you prefer without causing exception. I personally just change the dimensions of things and keep the ids same.

Kushan
  • 5,855
  • 3
  • 31
  • 45