I have a small doubt, While developing an Android App whose user interface can be used in both portrait and landscape modes. How it is possible to achieve this? Can someone explain briefly?
Asked
Active
Viewed 1,995 times
-1
-
create a layout-port and layout-land folders and create your xml's there. If you want to make it work differently and want to handle it on code then listen to onConfigurationChanges. – Lalith B Apr 08 '13 at 05:36
-
2look in to this http://developer.android.com/guide/practices/screens_support.html#qualifiers – Sankar V Apr 08 '13 at 05:37
3 Answers
0
To achieve this you need to create two different xml files with same name for portrait and landscape and put it in respective folders.
MyProject/
res/
layout/ # default (portrait)
main.xml
layout-land/ # landscape
main.xml

Chirag
- 56,621
- 29
- 151
- 198
0
You should have layouts for both landscape and portrait.
res/layout/main.xml
res/layout-land/main.xml
http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

Raghunandan
- 132,755
- 26
- 225
- 256