• Android——excise(用线性布局、表格布局、相对布局做发送邮件界面)


    LinearLayout

    <?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">
    
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="To"
                />
    
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Subject"
                />
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Message"
                android:textSize="20dp"/>
    
            <EditText
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="bottom"
                />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
    
            <Button
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:text="Reset"
                android:layout_weight="1"/>
            <Button
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:text="Send"
                android:layout_weight="1"
                />
    
        </LinearLayout>
    </LinearLayout>

    TableLayout

    <?xml version="1.0" encoding="utf-8"?>
    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:stretchColumns="1,2">
        <TableRow>
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="To"
                android:layout_span="2"/>
        </TableRow>
        <TableRow>
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Subject"
                android:layout_span="2"/>
        </TableRow>
        <TableRow>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Message"
                android:textSize="20dp"/>
        </TableRow>
        <TableRow
            android:layout_marginTop="550dp">
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_span="2"
    
                />
        </TableRow>
        <TableRow>
            <Button
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:paddingBottom="0dp"
                android:text="reset"
                android:layout_weight="1"/>
            <Button
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:paddingBottom="0dp"
                android:text="send"
                android:layout_weight="1"/>
        </TableRow>
    
    </TableLayout>

    RelativeLayout

    <?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">
    
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="To"
            android:id="@+id/to"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Subject"
            android:layout_below="@id/to"
            android:id="@+id/sub"
            />
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Message"
            android:textSize="20dp"
            android:layout_below="@id/sub"
            />
        <Button
            android:layout_width="190dp"
            android:layout_height="wrap_content"
            android:text="send"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:id="@+id/sen"
           />
        <Button
            android:layout_width="190dp"
            android:layout_height="wrap_content"
            android:text="reset"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            />
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_above="@id/sen"
            />
    
    </RelativeLayout>

  • 相关阅读:
    SpringBoot(八):SpringBoot中配置字符编码 Springboot中文乱码处理
    SpringBoot(二): SpringBoot属性配置文件 SpringBoot多环境配置文件 SpringBoot自定义配置文件
    使用Maven新建SpringBoot工程
    SpringBoot(四): SpringBoot web开发 SpringBoot使用jsp
    SpringBoot(三):SpringBoot热部署插件
    SpringBoot(六):SpringBoot中如何使用Servlet?
    ARQ自动重传请求与UDP提供可靠交付
    多线程程序中操作的原子性转帖
    多目录的Makefile
    VC++小小绘图程序
  • 原文地址:https://www.cnblogs.com/Chenshuai7/p/5321788.html
Copyright © 2020-2023  润新知