簡單的RelativeLayout布局,relativelayout布局

來源:互聯網
上載者:User

簡單的RelativeLayout布局,relativelayout布局

簡單的RelativeLayout布局執行個體

 

 1 <?xml version="1.0" encoding="utf-8"?> 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3     android:layout_width="match_parent" 4     android:layout_height="match_parent" 5      > 6  7     <TextView 8         android:id="@+id/textView1" 9         android:layout_width="wrap_content"10         android:layout_height="wrap_content"11         android:layout_alignParentTop="true"12         android:layout_centerHorizontal="true"13         android:layout_marginTop="20dp"14         android:text="Please input the username and password to log on."15         android:textSize="14sp"16         android:textAppearance="?android:attr/textAppearanceMedium"17         android:layout_marginLeft="20dp"18         android:layout_marginRight="20dp"19         android:layout_marginBottom="20dp"20          />21     <TextView 22         android:id="@+id/text_username"23         android:layout_width="wrap_content"24         android:layout_height="wrap_content"25         android:layout_below="@id/textView1"26         android:layout_alignLeft="@id/textView1"27         android:layout_marginRight="20dp"28         android:text="User Name:"29         android:textSize="20sp"30         android:layout_marginBottom="20dp"31         />32     33     <EditText 34         android:id="@+id/edit_username"35         android:layout_width="match_parent"36         android:layout_height="wrap_content"37         android:layout_alignBaseline="@id/text_username"38         android:layout_toRightOf="@id/text_username"39         android:layout_alignRight="@id/textView1"     40         android:layout_below="@id/textView1"41         />42           43     44     <TextView 45         android:id="@+id/text_psw"46         android:layout_width="wrap_content"47         android:layout_height="wrap_content"48         android:layout_below="@id/text_username"49         android:layout_alignLeft="@id/text_username"50         android:layout_marginRight="20dp"51         android:text="Password"52         android:textSize="20sp"53         />54 55     <EditText56         android:id="@+id/edit_psw"57         android:layout_width="wrap_content"58         android:layout_height="wrap_content"59         android:layout_alignBaseline="@id/text_psw"60         android:layout_alignLeft="@id/edit_username"61         android:layout_alignRight="@id/edit_username"62         android:layout_below="@id/edit_username"63         android:inputType="textPassword" />64 65     <Button66         android:id="@+id/btn_logon"67         android:layout_width="wrap_content"68         android:layout_height="wrap_content"69         android:layout_alignRight="@id/edit_psw"70         android:text="Log in"71         android:textSize="21sp"72         android:layout_below="@id/edit_psw"73         android:layout_marginTop="20dp"74         android:layout_marginLeft="20dp"75         />76 77     <Button78         android:id="@+id/btn_signin"79         android:layout_width="wrap_content"80         android:layout_height="wrap_content"81         android:layout_alignBaseline="@+id/btn_logon"82         android:layout_toLeftOf="@+id/btn_logon"83         android:text="Sign in"84         android:textSize="21sp" />85 86 </RelativeLayout>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.