1.LinearLayout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <!-- <Button --> <!-- android:id="@+id/button1" --> <!-- android:layout_width="wrap_content" --> <!-- android:layout_height="wrap_content" --> <!-- android:layout_gravity="top" --> <!-- android:text="Button 1" --> <!-- /> --> <!-- <Button --> <!-- android:id="@+id/button2" --> <!-- android:layout_width="wrap_content" --> <!-- android:layout_height="wrap_content" --> <!-- android:layout_gravity="center_vertical" --> <!-- android:text="Button 2" --> <!-- /> --> <!-- <Button --> <!-- android:id="@+id/button3" --> <!-- android:layout_width="wrap_content" --> <!-- android:layout_height="wrap_content" --> <!-- android:layout_gravity="bottom" --> <!-- android:text="Button 3" --> <!-- /> --> <EditText android:id="@+id/input_message" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="2" android:hint="Type Something" /> <Button android:id="@+id/send" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text = "Send" /> </LinearLayout>
2.RelativeLayout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="Button 3" /> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/button3" android:layout_above="@id/button3" android:text="Button 1" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@id/button3" android:text="Button 2" /> <Button android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/button3" android:layout_below="@id/button3" android:text="Button 4" /> <Button android:id="@+id/button5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/button3" android:layout_below="@id/button3" android:text="Button 5" /> </RelativeLayout>
3.FrameLayout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="Button 3" /> <ImageView android:id="@+id/p_w_picpathview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> </FrameLayout>
4.TableLayout
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="1" > <TableRow > <TextView android:layout_height="wrap_content" android:text="Account:" /> <EditText android:id="@+id/account" android:layout_height="wrap_content" android:hint="input your account" /> </TableRow> <TableRow > <TextView android:layout_height="wrap_content" android:text="Password:" /> <EditText android:hint="@+id/password" android:layout_height="wrap_content" android:inputType="textPassword" /> </TableRow> <TableRow> <Button android:id="@+id/button" android:layout_height="wrap_content" android:layout_span = "2" android:text="Login" /> </TableRow> </TableLayout>

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
文章題目:android自學筆記2-布局-創(chuàng)新互聯(lián)
轉載注明:http://www.yijiale78.com/article10/ddcjdo.html
成都網站建設公司_創(chuàng)新互聯(lián),為您提供企業(yè)網站制作、域名注冊、營銷型網站建設、軟件開發(fā)、品牌網站制作、小程序開發(fā)
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)