zoukankan      html  css  js  c++  java
  • 简单的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     <EditText
    56         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     <Button
    66         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     <Button
    78         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>
  • 相关阅读:
    杂题之求1-100连续不重复整数中的缺少的一个数
    C语言之位运算
    程序员的激情其实是一种痛苦
    主机windwo7+虚拟机centos如何配置虚拟机可以上网,且与主机互ping通
    MyEclipse Servers视窗出现“Could not create the view: An unexpected exception was thrown”错误解决办法
    一个web项目在myeclipse中add deployment时无法被识别出来的原因
    Hibernate中,将session绑定到线程时,在保存和查询数据的代码里,要正确的关闭session
    springframwork历史版本下载地址
    在web项目中使用cxf开发webservice,包含spring支持
    [转] Spring Security(01)——初体验
  • 原文地址:https://www.cnblogs.com/izhanjun/p/4204989.html
Copyright © 2011-2022 走看看