0

I have two sizes of 5.1 inches, a 4-inch for 480x800. When I design in 5.1 screen and run with 4 inch screen, I have some trouble that some button missed position on screen. I designed by layout.

bytecode77
  • 14,163
  • 30
  • 110
  • 141
Michael Le
  • 39
  • 1
  • 9
  • You should post your layout XML – SuperFrog Oct 15 '15 at 10:34
  • You should design a layout in such a way that it can be compatible with all devices, if you can't, make different layouts for different resolution devices. Create folder called layout-sw600dp and create designs accordingly – Apurva Oct 15 '15 at 10:35
  • @Udi Idan This question is mean that how to design multisize (have a same pixel) in android. – Michael Le Oct 15 '15 at 10:37
  • Start by reading this: http://developer.android.com/guide/practices/screens_support.html – SuperFrog Oct 15 '15 at 10:39

2 Answers2

1

Android runs on a variety of devices that offer different screen sizes and densities. For applications, the Android system provides a consistent development environment across devices and handles most of the work to adjust each application's user interface to the screen on which it is displayed.

Please read below Links

  1. Supporting Multiple Screens
  2. How to support multiple screen in Android

How to support different screen size in android

Supporting multiple screen size - Android

Community
  • 1
  • 1
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

Place your view inside a <ScrollView>. Doing so will mean users with smaller devices will be able to scroll the view if it is too large.

vguzzi
  • 2,420
  • 2
  • 15
  • 19
  • Depending on the size of you're view this is sometimes something which you have to do. If you are setting everything in your layout with the which requires a size with the 'dp' keyword and supplying Android with all of the drawables that it needs then Android should scale up/down depending on the users screen size. If it isn't doing so then you must be doing something wrong. But we can't spot your error if you don't supply us with any of your code. – vguzzi Oct 15 '15 at 10:46
  • 1
    I didn't ask the question. Please don't try to teach someone how to support multiple screen sizes by throwing all the views into a ScrollView. – SuperFrog Oct 15 '15 at 10:48
  • That is the correct thing to do.. Most of the time you should be wrapping your content in a `ScrollView` which will in turn do nothing unless the user can't see all of your views. You don't need to 'support' multiple screen sizes, Android does it for you. – vguzzi Oct 15 '15 at 10:50
  • 1
    I think that's a very bad practice, but I guess everyone is entitled for their own opinion. – SuperFrog Oct 15 '15 at 10:52
  • It's not bad practice at all.. Android supports a variety of screen sizes you cannot always be sure that all of you're views will be view-able, especially if your layout's height is quite big. If you are only displaying a couple of views then fair enough but this doesn't seem to be the case. – vguzzi Oct 15 '15 at 10:55