0

enter image description hereI am unable to implement the auto-layout concept in Android Studio as i used to do in in Xcode.

Here are the screenshots, one is on Nexus One screen and another one is on Nexus 7's big screen. View aren't getting adjusted automatically according to the screen size.

InsaneCat
  • 2,115
  • 5
  • 21
  • 40

1 Answers1

0

I haven't seen your code but there are a few things you can try:

  • Use different drawables for different screen densities (drawables-hdpi, drawables-xhdpi and so on).
  • In your .xml file when defining your sizes use dp instead of px. dp or display pixels will fill the screen according to how many pixels there are rather than assuming there are the same amount of pixels on each screen.
  • Use Margins instead of absolute sizes. (e.g. android:layout_marginLeft="2dp") would mean that that item lets say a button will be 2 display pixels from the left margin of the phone.
    • That's some good advice for using StackOverflow. Since it doesn't relate to the answer, specifically, maybe it should be posted as comments instead. – Jacob Jan 06 '18 at 02:55