简体   繁体   中英

Android: Layout not fitting on screen, allthough it should

I have written an android app and have tested it for all kind of screen sizes and densities (Using the android emulator). I have also tested the layout for relatively small screen sizes, for example the WQVGA device (3,3", ldpi, 240 x 400)) and it's working fine. I have two physical devices (sony z3 compact with 4,6" and sony xperia v (4,3"), which display the layout in the correct way. Lately a friend came over and i wanted to show him the app on his smartphone (sony galaxy s2 plus (4,3")) and the layout was totally destroyed, meaning that the display seemed to small. TextViews and buttons weren't displayed properly.

I don't really understand this. All those devices are in the category "medium". And the screen size of the S2 Plus is equal to the one of the Sony Xperia V (and even a lot bigger than the WQVGA). So why does this device display my layout properly. I want to use the old size-qualifiers (small, medium, large, xlarge), because i target api-level 11.

How can i solve this issue? I don't want to redesign my layout for medium-devices, since it really looks the way i want it to look on all the devices, which work properly.

Actually you are confused between resolution & screen size.Galaxy S2 Plus & Sony Xperia V have same screen size but their resolution are different 480*800 pixels & 720*1280 pixels respectively.So both device are under different resolution so your application supports xhdpi & ldpi but doesn't in hdpi.You should provide support for hdpi.For more clarification you should provide code. For more reference refer:

1.http://android-developers.blogspot.in/2009/10/support-for-additional-screen.html
2.http://developer.android.com/guide/topics/manifest/compatible-screens-element.html
3.http://developer.android.com/guide/practices/screens_support.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM