Adding a Layout to bottom of the screen inside a ScrollView in Landscape mode

Posted by andreea on Stack Overflow See other posts from Stack Overflow or by andreea
Published on 2010-06-08T13:13:19Z Indexed on 2010/06/09 6:52 UTC
Read the original article Hit count: 419

Filed under:
|
|
|
|

I have the following layout which works in Portrait mode: the Layout with the id LinearLayout02 is placed at the bottom of the screen. The problem appears when flipping to Lanscape mode, when the #LinearLayout02 is placed at the top of the screen.

The question is how do I position #LinearLayout02 at the bottom of the screen in both Portrait and Landscape mode?

(This happens on G1 and Xperia)

Thank you

The following code is placed inside a ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent" android:fillViewport="true">

    <LinearLayout
        android:id="@+id/sLayout"
        android:layout_height="wrap_content" 
        android:layout_width="fill_parent" 
        android:orientation="vertical" 
        android:paddingTop="2dip"
        android:layout_alignParentTop="true"
        android:gravity="top" >
    .....
             </LinearLayout>

         <LinearLayout
    android:id="@+id/LinearLayout02" 
    android:background="@drawable/bottombar_bg" 
    android:layout_width="fill_parent" 
    android:paddingTop="10dip" 
    android:layout_height="56dip" 
    android:layout_alignParentBottom="true" 
    android:gravity="bottom" >

    <Button 
        android:id="@+id/navigate" 
        style="@style/mainBottomTabsButtonNormal"
        android:drawableLeft="@drawable/icon_navigation"
        android:text="@string/navigationSettings" 
        android:layout_gravity="left">
    </Button>
    <Button 
        android:id="@+id/search" 
        style="@style/mainBottomTabsButtonActive"
        android:drawableLeft="@drawable/icon_search"
        android:text="@string/search.label" 
        android:layout_gravity="right">
    </Button>
</LinearLayout>
   </RelativeLayout>

© Stack Overflow or respective owner

Related posts about java

Related posts about android