Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify different layouts for portrait and landscape orientations?

I've seen references to being able to specify two separate layout xml files for an activity, one for Portrait and one for Landscape. I've not been to find any information on how to do that though. How do I specify for each activity which xml file is it's portrait layout and which is the Landscape layout?

Is it also possible to specify different layouts for different screen sizes? If so, how is this done?

like image 985
Jay Askren Avatar asked Jan 23 '10 17:01

Jay Askren


People also ask

How do I make different layouts portrait and landscape orientations?

Android App Development for Beginners Step 3 – Create a layout file by right-clicking on the resources, name the file, from the 'Available qualifiers, select Orientation. Click >> option. Select Landscape from UI mode.

How do I create a separate layout for landscape mode?

I think the easiest way in the latest Android versions is by going to Design mode of an XML (not Text). Then from the menu, select option - Create Landscape Variation. This will create a landscape xml without any hassle in a few seconds.

How do I make only certain pages landscape?

Change part of a document to landscape Select the content that you want on a landscape page. Go to Layout, and open the Page Setup dialog box. Select Landscape, and in the Apply to box, choose Selected text.

Where you can choose a vertical portrait or horizontal landscape layout?

Choose either landscape (horizontal) or portrait (vertical) orientation for all, or part, of your document. Click PAGE LAYOUT > Orientation. Click Portrait, or Landscape.


1 Answers

Create a layout-land directory and put the landscape version of your layout XML file in that directory.

like image 148
Mark B Avatar answered Oct 15 '22 09:10

Mark B