<?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:background="@color/bkgrndclr">
<Button
android="@+id/imgbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search Images"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
<Button
android="@id/imgbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search Web"
android:layout_alignBottom="@id/imgbtn"
android:layout_toLeftOf="@id/imgbtn" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/imgbtn"
android:layout_alignRight="@id/imgbtn" />
</LinearLayout>
我將按鈕設置到視圖的底部以及它們上方的文本框中,但爲什麼都是線性顯示。按鈕搜索圖像首先顯示然後搜索網頁然後是文本框,它們不位於底部,這不是我想要的。在主佈局上定位對象意外失敗
變化的LinearLayout到RelativeLayout的 –
但一個按鈕消失,文本框的Movex到視圖 –