开发者

How do I set the footer of linear layout?

I've got the following:

 <?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"
>
<ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/imageView1"  android:background="@drawable/header"></ImageView>
<LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="match_parent">
</LinearLay开发者_StackOverflow社区out>
<EditText android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/editText2" android:text="EditText"></EditText>
<EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/editText1" android:text="EditText"></EditText>
<LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout2" android:layout_width="match_parent" android:layout_gravity="bottom">
    <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:background="@drawable/footer" android:id="@+id/imageView2" android:layout_gravity="bottom"></ImageView>
</LinearLayout>

I want put the image at the footer, not after the text boxes. Please help I am new to the android and I'm looking for help.


<?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"
>
<ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/imageView1"  android:background="@drawable/header"></ImageView>
<LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="match_parent">
</LinearLayout>
<EditText android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/editText2" android:text="EditText"></EditText>
<EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/editText1" android:text="EditText"></EditText>

<RelativeLayout android:id="@+id/relLayout"
     android:layout_height="fill_parent" 
     android:layout_width="match_parent" >
    <ImageView android:layout_height="wrap_content" 
           android:layout_width="wrap_content" 
           android:background="@drawable/footer" 
           android:id="@+id/imageView2" 
           android:layout_alignParentBottom="true"></ImageView>
</RelativeLayout >
......


it is better to use a RelativeLayout instead of LinearLayout

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜