安卓界面控件屏幕居中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控件源码,现在就给大家分享一下,源码我已经上传到源码天堂那里了,想下载的朋友可以去那里下载吧 ...
随机推荐
- BootStrap框架
简介: Bootstrap,来自 Twitter,是目前很受欢迎的前端框架.Bootstrap 是基于 HTML.CSS.JAVASCRIPT 的,它简洁灵活,使得 Web 开发更加快捷,是一个CSS ...
- [原]centos6.5系统可用yum源(32位)以及rpmforge
[10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686 gpgche ...
- Makefile中静态库,动态库的创建和使用以及解压缩命令
应用层通过操作文件操控硬件 使用制作好的工具链: 刚开始学习时,用一些已经制作好的工具链,使用以下命令解压到gcc-3.4.5-glibc-2.3.6目录 cd /work/tools tar xjf ...
- 内网公告牌获取天气信息解决方案(C# WebForm)
需求:内网公告牌能够正确显示未来三天的天气信息 本文关键字:C#/WebForm/Web定时任务/Ajax跨域 规划: 1.天定时读取百度接口获取天气信息并存储至Txt文档: 2.示牌开启时请求Web ...
- Unity自动场景保存脚本
新建一个名为AutoSave的编辑器脚本,并放于Assets/Editor下. using System; using UnityEditor; using UnityEditor.SceneMana ...
- css基本设置
css引入方式: 头部引入:在HTML页面头部编写程序(一般用在访问量大的网页上) 标签内引入:在标签内直接写样式(优先级最高,但难于维护,会沉积大量代码) 外部引入:用link标签引入(常用 ,维护 ...
- iredmail安装脚本分析(三)---conf/global DISTRO值的来源及操作系统的判断
作者在引入conf/global 文件时,就已经对操作系统的类型进行判断,同时也对DISTRO进行了赋值. 部分代码,如图: 显然文件里的KERNEL_NAME的值就是判断完成的操作系统,具体分析该值 ...
- Reconstruct Itinerary
Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], r ...
- dotproject 2.1.8 甘特图中文乱码解决
1.安装中文语言包 下载地址为http://www.dotproject.net/dpDownloads/Language_Packs/Chinese_Simplified_(GBK)/dotproj ...
- node.js Websocket消息推送---GoEasy
Goeasy, 它是一款第三方推送服务平台,使用它的API可以轻松搞定实时推送!个人感觉goeasy推送更稳定,推送 速度快,代码简单易懂上手快 浏览器兼容性:GoEasy推送 支持websocket ...