Arpit_H
Arpit_H

Reputation: 254

Android : orientation issue

Issue !!!

I need to develop an application for tablet (v3.1) in both portrait and landscape orientation.

I have placed the resources:- For Portrait - Images in "drawable" and Layouts in "layout"

For Landscape - Images in "drawable-large" and Layouts in "layout-large"

Issue is that the landscape layouts are not picking the right images.

Can someone please help?

Upvotes: 2

Views: 448

Answers (3)

Android
Android

Reputation: 2393

1.Create two main.xml files for layout in both case: landscape and portrait.

2.Put those two main.xml in resources according to its type:

/res/layout-land/main.xml

/res/layout-port/main.xml

Just build and try your application GUI in runtime.

or another example...

create only "layout-land" folder and copy paste your xml file.

/res/layout/main.xml

/res/layout-land/main.xml

Upvotes: 2

Kayhan Asghari
Kayhan Asghari

Reputation: 2854

layout-large is for devices with large screens, and also we have for example layout-small. the folder you need is layout-land, that the "land" part stands for landscape.

Upvotes: 1

Paresh Mayani
Paresh Mayani

Reputation: 128448

I think your layout folder should be renamed as layout-large-land or simply layout-land

The below snap is from Supporting Multiple Screens document. enter image description here

Upvotes: 0

Related Questions