zoukankan      html  css  js  c++  java
  • android 线性布局

    activity_main.xml线性布局

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
    
        tools:context="com.hanqi.test6.MainActivity"
    
        android:orientation="vertical"
        android:gravity="center_horizontal"
        android:padding="16dp"
        >
        <!--
        orientation改方向   vertical垂直  horizontal水平
        gravity内部对齐方式   right居右   center整个屏幕居中
        padding 边距
        -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
    
            >
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="账号:"
                />
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="请输入用户名"/>
            <!--hint  提示输入信息-->
    
        </LinearLayout>
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="密码:"
                />
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="请输入密码"
                android:password="true"
                />
            <!--password  是否是密码框-->
    
        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            >
    
            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="登陆"
                android:layout_weight="1"
                />
            <!--layout_weight  权重-->
            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="注册"
                android:id="@+id/button2"
                android:layout_weight="1"
                />
            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="取消"
                android:layout_weight="1"
                />
        </LinearLayout>
    
    
    
    </LinearLayout>

  • 相关阅读:
    flash做的按扭突然在页面上获取不到焦点之后
    收集 关于js的接口和 继承实现的代码例子
    从我丢失了;号 之后说开来去
    你真的会写JavaScript吗?
    json.js + jquery 在 ie7下 的 bug
    如何减少浏览器的repaint和reflow? [转]
    2012我们需要什么样的前的工程师
    JavaScript是否可实现多线程 — 深入理解JavaScript定时机制
    是时候了,我们需要前端架构师
    JS事件模型小结
  • 原文地址:https://www.cnblogs.com/cuikang/p/5317184.html
Copyright © 2011-2022 走看看