linearlayout 水平垂直居中
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="right"
android:text="用户名" />
<EditText
android:layout_width="300dp"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Email" />
<EditText
android:layout_width="300dp"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
linearlayout 水平垂直居中的更多相关文章
- Android开发点滴 - 如何使按钮水平垂直居中且始终占据屏幕宽度一半
问题描述: 如何使按钮水平垂直居中且始终占据屏幕宽度一半 效果如下: 竖屏: 横屏: 解决方案: 使用线性布局,指定线性布局的总权重(weightSum)为1, 指定按钮的权重为其一半即0.5 布局代 ...
- CSS实现水平|垂直居中漫谈
利用CSS进行元素的水平居中,比较简单,手到擒来:行级元素设置其父元素的text-align center,块级元素设置其本身的left 和 right margins为auto即可.而撸起垂直居中, ...
- IE6+未知尺寸元素水平垂直居中
首先讨论在IE8以上(也就是支持伪元素after的基础上)的2种情况 当有一段不知道长度大小的文字在你面前,你需要使它垂直居中的时候,你肯定会想到:1.text-align:center;水平居中没错 ...
- css水平垂直居中对齐方式
1.文字或者内联元素的垂直水平居中对齐 css属性 -- 水平居中:text-aligin:center; 垂直居中: line-height:height; 例子:. html: <div c ...
- CSS实现元素水平垂直居中—喜欢对称美,这病没得治
[TOC] 在CSS中对元素进行水平居中是非常简单的:如果它是一个行内元素,就对它的父元素应用text-align:center;如果它是一个块级元素,就对它自身应用margin:auto.然而要对一 ...
- CSS之水平垂直居中
在css的世界里,如果我们想让一个块级元素水平居中,想必大家都知道利用margin:0 auto;嘛,这样就可以让块级元素在它的父元素中水平居中了. 列如这样: <!DOCTYPE html&g ...
- 【前端攻略】最全面的水平垂直居中方案与flexbox布局
最近又遇到许多垂直居中的问题,这是Css布局当中十分常见的一个问题,诸如定长定宽或不定长宽的各类容器的垂直居中,其实都有很多种解决方案.而且在Css3的flexbox出现之后,解决各类居中问题变得更加 ...
- CSS3中flexbox如何实现水平垂直居中和三列等高布局
最近这些天都在弥补css以及css3的基础知识,在打开网页的时候,发现了火狐默认首页上有这样一个东西.
- 把简单做好也不简单-css水平垂直居中
44年前我们把人送上月球,但在CSS中我们仍然不能很好实现水平垂直居中. 作者:Icarus 原文链接:http://xdlrt.github.io/2016/12/15/2016-12-15 水平垂 ...
随机推荐
- iOS 应用内付费(IAP)开发步骤
折腾好几天,原来是税务信息没有填写,哎... 国内就是好啊,没有这些麻烦的事情... :) 等24小时,等税务的审核结果... 有结论了 才能测试内购.... 如果税务信息没有填写完毕,p ...
- weka平台
weka平台界面简介 纵向排列的四个主要功能 1.探索(写自己的代码) 2.实验(比较算法) 3.可视化 4.命令行 1.探索 先将weka-src.jar文件解压到一个文件夹 将文件夹导入到Elip ...
- weka数据挖掘拾遗(三)----再谈如果何生成arff
前一阵子写过一个arff的随笔,但是写完后发现有些啰嗦.其实如果使用weka自带的api,生成arff文件将变成一件很简单的事儿. 首先,可以先把特征文件生成csv格式的.csv格式就是每列数据都用逗 ...
- 基于Theano的DNN框架Blocks使用简要总结
Blocks官方代码地址:https://github.com/mila-udem/blocks Blocks是加拿大Montreal大学Bengio实验室牵头开发的基于Python的神经网络模型框架 ...
- dd命令刻录u盘启动盘
dd命令来刻录windows启动盘 dd if=/ home/avi/Downloads/Win10_English_x64.iso of=/ dev/sdb1 bs=51M; sync dd命令详解 ...
- 深入理解Java内存模型(五)——锁
锁的释放-获取建立的happens before 关系 锁是java并发编程中最重要的同步机制.锁除了让临界区互斥执行外,还可以让释放锁的线程向获取同一个锁的线程发送消息. 下面是锁释放-获取的示例代 ...
- poj - 3723 Conscription(最大权森林)
http://poj.org/problem?id=3723 windy需要挑选N各女孩,和M各男孩作为士兵,但是雇佣每个人都需要支付10000元的费用,如果男孩x和女孩y存在亲密度为d的关系,只要他 ...
- 将Android Studio工程导入到Eclipse中
1.前言 studio项目中src/main/java目录里面的代码对应的是eclispe项目中的src目录中的代码. 而studio中src目录里面包括整个项目的所有代码包括资源文件和xml. 2. ...
- BZOJ 2956 模积和
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2956 题意:给出n和m.计算: 思路: i64 n,m; i64 cal(i64 m,i ...
- ssh传输出现encountered 1 errors during the transfer解决办法
以下方法简单排序,从简单到复杂: 法一:在SSH Secure File Transfer(上传文件那个),打开“Operation”菜单,打开“File Transfer Mode”子菜单,再选择“ ...