android:baselineAligned属性
对于可以显示文字的View(如TextView,Button等),它的baseline 指的是这个UI控件中文字Text的baseline 到UI控件顶端的偏移值,可以通过View 的getBaseline()返回,如果一个View不支持baseline 对齐(比如ImageView) getBaseline()返回-1.
LinearLayout 带有一个属性android:baselineAligned 其缺省为true,也就是当使用android:orientation 为horizontal ,其子View的baseline 是对齐的,表现在不同View显示的文字的baseline是对齐的。
如本例: 在顶部显示 TextView, Button ,TextView 文字的基准线(baseline)是对齐的。
可以将android:baselineAligned 设为false 做个比较:
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
android:orientation=”horizontal”
android:baselineAligned=”false”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”>
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_marginRight=”3dip”
android:text=”@string/baseline_1_label” />
<Button
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_marginRight=”3dip”
android:text=”@string/baseline_1_button” />
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:textSize=”20sp”
android:text=”@string/baseline_1_bigger” />
</LinearLayout>

android:baselineAligned属性的更多相关文章
- 我的Android进阶之旅------>关于android:layout_weight属性的详细解析
关于androidlayout_weight属性的详细解析 效果一 效果二 图3的布局代码 图4的布局代码 效果三 图7代码 图8代码 效果四 效果五 版权声明:本文为[欧阳鹏]原创文章,欢迎转载,转 ...
- android:exported 属性详解
属性详解 标签: android 2015-06-11 17:47 27940人阅读 评论(7) 收藏 举报 分类: Android(95) 项目点滴(25) 昨天在用360扫描应用漏洞时,扫描结果, ...
- Android weight属性详解
android:layout_weight是一个经常会用到的属性,它只在LinearLayout中生效,下面我们就来看一下: 当我们把组件宽度设置都为”match_parent”时: <Butt ...
- 修改Android系统属性SystemProperties.set("sys.powerctl", "shutdown")关机分析
简介: 从之前的博文中我们提到过,关机流程中最后是通过修改Android属性进行关机操作(SystemProperties.java通过JNI调用访问系统属性),当然我们也可以通过adb命令修改And ...
- android:digits属性
android:digits属性限定输入的字符 可以用于密码输入等输入框 ex: 个人意见: 但是这样的话不符合要求的字符直接输入不上去,可能会给用户造成困惑,最好给出提示或用其他工具. 本文欢迎转载 ...
- android布局属性详解
RelativeLayout用到的一些重要的属性: 第一类:属性值为true或false android:layout_centerHrizontal 水平居中 android:layout_cen ...
- Android开发实战(二十一):浅谈android:clipChildren属性
实现功能: 1.APP主界面底部模块栏 2.ViewPager一屏多个界面显示 3......... 首先需要了解一下这个属性的意思 ,即 是否允许子View超出父View的返回,有两个值true . ...
- Android:关于声明文件中android:process属性说明
笔者在学习Android Service组件的过程中碰到了一个问题,就是在Android应用的声明文件Manifest.xml中有时候会对相关的服务标签设置一个android:process=&quo ...
- Android - 控件android:ems属性
Android - 控件android:ems属性http://blog.csdn.net/caroline_wendy/article/details/41684255?utm_source=tui ...
随机推荐
- CentOS 5.x 多个ISO文件 安装方法(VMware)
CentOS下载地址:http://mirror.centos.org/centos/ CentOS版本:5.11 VMware版本:11.1.0 CentOS 5.11有两个ISO: CentOS- ...
- [Baltic2004]数字序列
原题请见<左偏树的特点及其应用>BY 广东省中山市第一中学 黄源河 题意 给出序列\(a[1...n]\),要求构造序列\(b[1...n]\)使得\(\sum_{i=1}^{n}|a_i ...
- C++堆栈详解
一.预备知识-程序的内存分配 一个由c/C++编译的程序占用的内存分为以下几个部分 1.栈区(stack)- 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等.其操作方式类似于数据结构中的栈. ...
- linux字符集介绍及解决中文乱码实战
字符集对应配置文件:/etc/sysconfig/i18n 先备份再修改: 备份:cp /etc/sysconfig/i18n /etc/sysconfig/i18n.oldboy.20150521 ...
- 【BZOJ3529】【SDOI2014】数表
Time Limit: 1000 ms Memory Limit: 512 MB Description 有一张n×m的数表,其第i行第j列 (1≤i≤n,1≤j≤m)的数值为能同时整除i和j的所有自 ...
- Cannot find a valid baseurl for repo: base
Linux下执行yum命令的时候一直报错:Cannot find a valid baseurl for repo: base 网上找了好多办法都没有解决... 我之前也遇到过一次, vi /etc/ ...
- 《阿里巴巴Android编码规范》阅读纪要(二)
版权声明:本文出自汪磊的博客,转载请务必注明出处. 本篇继续上一篇<阿里巴巴Android编码规范>阅读纪要(一) ,还是建议各位同学有时间完整阅读一下<阿里巴巴Android编码规 ...
- python自动拉取备份压缩包并删除3天前的旧备份
业务场景,异地机房自动拉取已备份好的tar.gz数据库压缩包,并且只保留3天内的压缩包文件,用python实现 #!/usr/bin/env python import requests,time,o ...
- 三十天学不会TCP,UDP/IP网络编程 - RST的用法
不知不觉也写了这么多了,继续我的自己的推广大业~完整版可以去gitbook(https://www.gitbook.com/@rogerzhu/)看到. 如果对和程序员有关的计算机网络知识,和对计算机 ...
- 本地mysql无法连接原来是这里有问题啊。。。。。。
1.怎么解决localhost无法链接本地mysql数据库问题_百度经验http://jingyan.baidu.com/article/d45ad14896d1cd69542b805c.html 2 ...