zoukankan      html  css  js  c++  java
  • andorid 三种方式的练习

    layout1   线性布局

    <?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>

    layout2   表格布局

    <?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="300dp">
            <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>

    layout3    网格布局

    <?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>
  • 相关阅读:
    移动前端工作的那些事---前端制作之动画效率问题简析
    PHP从零开始-笔记-面向对象编程的概念
    php从零开始
    jquery表单验证
    Jquery网页加载进度条(随笔,当然要随便写,当日记动态心情写咯)
    Jquery实现花瓣随机飘落(收藏自慕课网)
    seajs的那点事(很坑的事),和本白的一点事(更坑的事)
    js高级群的一些整理6月
    有关jquery checkbox获取checked的问题
    最近忙着考试又是什么的,然后群里都在秀战绩,秀一下那些年的战绩吧
  • 原文地址:https://www.cnblogs.com/cuikang/p/5327082.html
Copyright © 2011-2022 走看看