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>

android 线性布局的更多相关文章

  1. Android线性布局(Linear Layout)

    Android线性布局(Linear Layout) LinearLayout是一个view组(view group),其包含的所有子view都以一个方向排列,垂直或是水平方向.我们能够用androi ...

  2. Android 线性布局(LinearLayout)相关官方文档 - 指南部分

    Android 线性布局(LinearLayout)相关官方文档 - 指南部分 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用 ...

  3. Android 线性布局(LinearLayout)相关官方文档 - 布局參数部分

    Android 线性布局(LinearLayout)相关官方文档 - 布局參数部分 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商 ...

  4. android—-线性布局

    android五大布局之线性布局. 1.线性布局的特点:各个子元素彼此连接,中间不留空白 而今天我们要讲解的就是第一个布局,LinearLayout(线性布局),我们屏幕适配的使用 用的比较多的就是L ...

  5. Android线性布局

    线性布局 LinearLayout 是一个视图组,用于使所有子视图在单个方向(垂直或水平)保持对齐. 您可以使用 android:orientation 属性指定布局方向. LinearLayout ...

  6. Android线性布局和帧布局

    第二次,本牛崽十分从容,今天咱们来讲讲Android Q之布局,我遇到的问题与自己学到的,大牛不要嘲笑哈,有错误可以指出来,本牛崽看到就改了. 今天我的学长跟我们开始了布局,布局看资料说好像有5种,又 ...

  7. [android] 线性布局和布局的组合

    /****************2016年4月25日 更新******************************/ 知乎:对于开发者来说,Android 的开发者选项里有哪些实用的功能? 汤涛 ...

  8. Android 线性布局 LinearLayout

    垂直布局 vertical <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

  9. iOS - starckView 类似Android线性布局

    同iOS以往每个迭代一样,iOS 9带来了很多新特性.UIKit框架每个版本都在改变,而在iOS 9比较特别的是UIStackView,它将从根本上改变开发者在iOS上创建用户界面的方式.本文将带你学 ...

随机推荐

  1. swift和OC中frame的小差异

    //1.0 OC中 CGRect .CGPoint.CGSize 的结构如下: struct CGRect { CGPoint origin; CGSize size; }; struct CGPoi ...

  2. SAP 使用

    SAP 提供多种方法查找系统内的事务代码 1. 使用SE11查看存储事物代码的表:TSTC 或者TSTCT TSTC: 存有事务代码,程序名称,屏幕号码等字段 TSTCT: 存有语言代码,事务代码,事 ...

  3. target=_blank攻击

    [target=_blank攻击] 在<a>标签中加入 rel="noopener noreferrer" 来避免. 参考:https://mathiasbynens. ...

  4. substring 比较(c#和Java)

    Java中 string str = "123456"; str .substring(5); 结果:6 Substring(A)表示从原字符串的指定索引号A开始截取直到原字符串的 ...

  5. 安装FP

    一.安装Oracle 11.2 64-bit数据库 1.安装数据库软件并将SEINESCM数据库还原到服务器上, 2.配置监听和TNS信息 二.安装数据库32位客户端(为SSIS配套使用).安装ORA ...

  6. break

    public class b {   public static void main(String[] args) {  int i=0;  for(;i<=10;i++){   if (i&g ...

  7. php 更新array键值

    $arr1 = array("loginname" => "username","psw" => "password& ...

  8. Javascript之基本类型和引用类型

    ECMAScript变量可能包含两种不同数据类型的值:基本类型值和引用类型值,基本类型值指的是简单的数据段,而引用类型值指那些可能由多个值构成的对象. 在将一个值赋给变量时,解析器必须确定这个值是基本 ...

  9. 复杂链表的复制(python)

    题目描述 输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点),返回结果为复制后复杂链表的head.(注意,输出结果中请不要返回参数中的节点引用,否 ...

  10. openstack(Pike 版)集群部署(三)--- Glance 部署

    一.介绍 参照官网部署:https://docs.openstack.org/glance/queens/install/ 继续上一博客进行部署:http://www.cnblogs.com/weij ...