您好,登錄后才能下訂單哦!
要實現(xiàn)這種效果,
LinearLayout的嵌套實現(xiàn) 2.使用RelativeLayout
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingLeft="10dp" android:paddingRight="10dp" > <EditText android:id="@+id/EditText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/reminder" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <EditText android:id="@+id/dates" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" /> <EditText android:id="@+id/times" android:layout_width="100dp" android:layout_height="wrap_content" /> </LinearLayout> <Button android:id="@+id/button1" android:layout_width="96dp" android:layout_height="wrap_content" android:layout_gravity="right" android:text="提交" /> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="10dp" android:paddingRight="10dp" > <EditText android:id="@+id/EditText1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/reminder" /> <EditText android:id="@+id/dates" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/EditText1" android:layout_alignParentLeft="true" android:layout_toLeftOf="@+id/times" /> <EditText android:id="@+id/times" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_below="@+id/EditText1" android:layout_alignParentRight="true" /> <Button android:id="@+id/button1" android:layout_width="96dp" android:layout_height="wrap_content" android:layout_below="@id/times" android:layout_alignParentRight="true" android:text="提交" /> </RelativeLayout> <!-- android:layout_alignParentLeft="true" 和父控件左對齊 android:layout_toLeftOf="@+id/times" 在指定組件左邊 android:layout_below="@id/EditText1" 在指定組件下邊 -->
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。