Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 3.2 same layout for all screens

Tags:

android

layout

i set following layout configuration for my app

enter image description here

small,normal,large,xlarge screen layouts are fine for android 1.5 to 3.1. In android 3.2 all screens i.e

  • small (320 x 426 with density 160),
  • normal (320 x 470 with density 160),
  • large (480 x 640 with density 160) ,
  • xlarge (720 x 960 with density 240)

only takes layout-sw320dp . Is there any additional configuration required for android 3.2

note: i'm using eclipse with android plugin

like image 668
ArK Avatar asked Nov 03 '11 09:11

ArK


People also ask

How do I set Android layout to support all screen sizes?

Use “wrap_content” and “match_parent” To ensure that your layout is flexible and adapts to different screen sizes, you should use "wrap_content" and "match_parent" for the width and height of some view components.


1 Answers

With the layout management changes introduced in Android 3.2 (See http://developer.android.com/sdk/android-3.2.html#api & http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html) the most specific layout should be selected for the device being used. In this case layout-sw600dp should be selected for a 720 x 960 device.

For Android 3.2, you also need to specify which screen sizes your app supports in the manifest file using the element. http://developer.android.com/guide/practices/screens_support.html#DeclaringScreenSizeSupport http://developer.android.com/guide/topics/manifest/supports-screens-element.html

This is likely causing your issue.

like image 50
Danny D'Amours Avatar answered Oct 21 '22 05:10

Danny D'Amours