安卓界面控件屏幕居中Layout例子
经典的登录界面例子:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity = "center"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity = "center"
>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:textSize="16sp"
android:text="用户:"
android:layout_width="80dp"
android:layout_height="wrap_content" />
<EditText
android:layout_width="245dp"
android:layout_height="wrap_content"
android:imeActionId="@+id/login"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
android:layout_gravity="center_horizontal|bottom" />
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity = "center"
>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:textSize="16sp"
android:text="密码:"
android:layout_width="80dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/password"
android:layout_width="245dp"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true"
android:layout_gravity="center_horizontal|bottom" />
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_gravity="center_horizontal" />
<Button android:text="登录"
android:layout_width="120dp"
android:layout_height="wrap_content" />
</LinearLayout>
安卓界面控件屏幕居中Layout例子的更多相关文章
- 解析大型.NET ERP系统 灵活复杂的界面控件Infragistics WinForms
Infragistics 是.NET平台优秀的控件供应商,囊括了WinForms,ASP.NET,Silverlight,WPF,Windows Phone等所有关于微软.NET技术的界面控件.借助于 ...
- C#多线程操作界面控件的解决方案(转)
C#中利用委托实现多线程跨线程操作 - 张小鱼 2010-10-22 08:38 在使用VS2005的时候,如果你从非创建这个控件的线程中访问这个控件或者操作这个控件的话就会抛出这个异常.这是微软为了 ...
- InvokeHelper,让跨线程访问/修改主界面控件不再麻烦(转)
http://bbs.csdn.net/topics/390162519 事实上,本文内容很简单且浅显,所以取消前戏,直接开始.. 源代码:在本文最后 这里是一张动画,演示在多线程(无限循环+Thre ...
- WinForm 清空界面控件值的小技巧
原文:WinForm 清空界面控件值的小技巧 在WinForm里面有时候需要清空自己输入内容或是选择的选项,以便重新操作流程,那么一般你是怎么清空界面各个控件值的呢?如果窗体里面控件,尤其是TextB ...
- 扩展BindingList,防止增加、删除项时自动更新界面而不出现“跨线程操作界面控件 corss thread operation”异常
在做界面程序时,常常需要一些数据类,界面元素通过绑定等方式显示出数据,然而由于UI线程不是线程安全的,一般都需要通过Invoke等方式来调用界面控件.但对于数据绑定bindingList而言,没法响应 ...
- WinForm开发-界面控件到实体,实体到界面控件自动绑定
在WinForm开发中,我们是不是为绑定界面控件的数据而每个控件每个控件的赋值?在保存修改时是不是也是每个控件每个控件的赋值到实体中?字段一多,那简直就是噩梦.有没有像Web中那样方便的方法直接就自动 ...
- 基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用
在前面介绍了两篇关于我的基于MVC4+EasyUI技术的Web开发框架的随笔,本篇继续介绍其中界面部分的一些使用知识,包括控件的赋值.取值.清空,以及相关的使用. 我们知道,一般Web界面包括的界面控 ...
- 转--基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用
原文 http://www.cnblogs.com/wuhuacong/p/3317223.html 基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用 在前面介绍了两篇关于我的基 ...
- 很不错的安卓FadingActionBar控件源码
这个我刚刚从一个github下载过来的,自己测试一下运行了,感觉还不错的,安卓FadingActionBar控件源码,现在就给大家分享一下,源码我已经上传到源码天堂那里了,想下载的朋友可以去那里下载吧 ...
随机推荐
- android优秀Github源码整理
1.https://github.com/sd6352051/NiftyNotification 2.https://github.com/sd6352051/NiftyDialogEffects 3 ...
- 总结:视频播放的四种实现方案(Native)
一.来自 AVFoundation的 AVPlayer对象 特点: 1. AVPlayer > 优点: 可以自定义UI, 进行控制 > 缺点: ...
- 2016 - 2 - 20 ARC知识总结(二 autorelease概念及实现)
首先祝自己生日快乐~23咯~ 一 autorelease的概念 autorelease会像C语言的自动变量那样来对待对象实例.当超出作用域(相当于变量作用域)时,对象的实例release实力方法被调 ...
- YARN资料收集
hdfs2的HA: http://www.cnblogs.com/meiyuanbao/p/hadoop2.html
- WCF Restful 服务器配置文件
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSec ...
- 十DHT11
本实验是按照流程图的顺序去写的文章 据说DHT11没有小数部分,规格书是错误的.不过我验证的程序确实是没有小数 一.硬件连接:DHT11的数据线接到了PB10 二.实验代码 1.开始 2.初始化——串 ...
- PHP学习心得(1)——实用脚本
<?php 来表示 PHP 标识符的起始,然后放入 PHP 语句并通过加上一个终止标识符 ?> 来退出 PHP 模式 调用函数phpinfo(),将会看到很多自己系统的信息,以及预定义变量 ...
- js中的事件部分总结
一.HTML事件 HTML事件处理就是直接在HTML标签上添加事件,举例 <p class="" onclick=function(){alert(HTML事件)}>& ...
- Java高级规范之四
四十一.控制层不能调用model层除了最顶级的接口外的任何内容.要通过new顶级接口才能调用. 不规范示例: public class UserServiceImpl{ private UserDAO ...
- PAT (Advanced Level) Practise:1027. Colors in Mars
[题目链接] People in Mars represent the colors in their computers in a similar way as the Earth people. ...