Resizing layouts for orientation change?
Posted
by
Cole
on Stack Overflow
See other posts from Stack Overflow
or by Cole
Published on 2012-03-23T04:06:30Z
Indexed on
2012/03/23
5:29 UTC
Read the original article
Hit count: 483
Normal:
Landscape:
See how the ListView overlaps other things on the screen when in landscape mode? How can I keep this from happening?
XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/main" >
<RelativeLayout
android:id="@+id/myWishLists"
android:layout_width="fill_parent"
android:layout_height="50dp">
<Spinner
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:prompt="@string/optionsSpinner"
android:entries="@array/options" />
</RelativeLayout>
<TextView
android:id="@+id/myListsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/myWishLists"
android:layout_centerHorizontal="true"
android:text="My Wish Lists"
android:textStyle="bold"
android:textAppearance="?android:attr/textAppearanceLarge" />
<RelativeLayout
android:id="@+id/listsList"
android:layout_width="fill_parent"
android:layout_height="445dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">
<ListView
android:id="@+id/lists"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:entries="@array/entries" >
</ListView>
</RelativeLayout>
</RelativeLayout>
© Stack Overflow or respective owner