Just tried using the layout-land folder and it worked like a charm!  Just as
an FYI, it also works when using include tags in your layouts.  Below is the
configuration for my test case:

- res/layout
  - main.xml
  - view1.xml
  - view2.xml
  - view3.xml
- res/layout-land
  - view1.xml
  - view2.xml
  - view3.xml

The files view1, view2, view3 are set up differently for portrait or
landscape mode and main.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center_vertical"
>
    <include layout="@layout/view1" />
    <include layout="@layout/view2" />
    <include layout="@layout/view3" />
</LinearLayout>

Switching between portrait and landscape correctly picks the right views!

Is this documented anywhere?  I don't remember reading about the layout-land
folder anywhere...


----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Sat, Nov 7, 2009 at 9:32 AM, ElPollo Diablo <[email protected]> wrote:

> Excellent! Thanks for the help guys!
>
> On Nov 7, 9:20 am, Justin Anderson <[email protected]> wrote:
> > Interesting.... I did not know about the layout-land folder!
> >
> > On Nov 7, 2009 6:01 AM, "jbrohan" <[email protected]> wrote:
> >
> > I don't think it's necessary to check yourself, just provide the
> > landscape layout in the folder res/layout-land and leave the other one
> > in res/layout and the magic of Android will manage this for you.
> >
> > The problem with your pictures is probably that they have the wrong
> > aspect ration...they are portrait pictures that you are showing in
> > Landscape, so they are reduced in size.
> >
> > Good Luck
> > John
> >
> > On Nov 6, 1:23 pm, Justin Anderson <[email protected]> wrote: >
> What I
> > did for one of my apps...
> >
> > > On Thu, Nov 5, 2009 at 9:02 PM, ElPollo Diablo <[email protected]>
> >
> > wrote: > > Hello, > > >   I a...> >
> [email protected]<android-beginners%[email protected]>
> <android-beginners%[email protected]<android-beginners%[email protected]>
> ><android-beginners%2Bunsubscr
> >
> > [email protected]>
> >
> > > > For more options, visit this group at > >
> >
> > http://groups.google.com/group/android-beginners?hl=en...
> > --
> >
> > You received this message because you are subscribed to the Google Groups
> > "Android Beginners" group....
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-beginners%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to