楼主英语水平差,翻译的不好的话请多多指正,嘿嘿。。。

A Layout that arranges its children in a single column or a single row. The direction of* the row canbe set by
calling {@link #setOrientation(int) setOrientation()}.* You can also specify gravity, which specifies the
alignment of all the child elements by* calling {@link #setGravity(int) setGravity()} or specify that specific
children* grow to fill up any remaining space in the layout by setting the <em>weight</em> member of
{@link android.widget.LinearLayout.LayoutParams LinearLayout.LayoutParams}.* The default orientation is
horizontal.
这是一个将子类排列在一列或一行的布局。通过调用 setOrientation()可以设置行的方向。您还可以指定对其方向,它指定
所有子元素的对齐方式的方法叫做{ @link # setGravity(int)setGravity()}或通过设置权重/weight(< em > < / em >的
成员)指定特定的子类填满剩余的空间布局 { @link android.widget.LinearLayout。LayoutParams LinearLayout.
LayoutParams }。默认的方向是水平的。
/**
* Don't show any dividers.
*不显示任何分割线
*/
public static final int SHOW_DIVIDER_NONE = 0;
/**
* Show a divider at the beginning of the group.
* 显示分割线在这个视图组之前
*/
public static final int SHOW_DIVIDER_BEGINNING = 1;
/**
* 显示分割线在这个布局的每个子视图之间
* Show dividers between each item in the group.
*/
public static final int SHOW_DIVIDER_MIDDLE = 2;
/**
*显示分割线在这个布局的最后
* Show a divider at the end of the group.
*/
public static final int SHOW_DIVIDER_END = 4;

首先画一根线,采用shape.xml绘制:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:shape = "rectangle">

<size
android:width= "@dimen/fab_margin"
android:height= "@dimen/fab_margin" />

<solid android:color= "#ff00ff" />

</shape>

示例代码1设置分割线显示在子类最前方:
<LinearLayout
android:layout_width="fill_parent"
android:gravity="center"
android:divider="@drawable/driver"<!--设置分割线样式-->
android:showDividers="beginning"<!--设置分割线显示方式-->
android:layout_height="fill_parent"
android:orientation="horizontal">
<Button
android:id="@+id/bt1"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="1"/>
<Button
android:id="@+id/bt2"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="2"/>
<Button
android:id="@+id/bt3"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="3"/>
</LinearLayout>
示例2显示分割线在这个布局的每个子视图之间:
<LinearLayout
android:layout_width="fill_parent"
android:gravity="center"
android:divider="@drawable/driver"
android:showDividers="end"
android:layout_height="fill_parent"
android:orientation="horizontal">
<Button
android:id="@+id/bt1"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="1"/>
<Button
android:id="@+id/bt2"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="2"/>
<Button
android:id="@+id/bt3"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="3"/>
</LinearLayout>
示例3*显示分割线在这个布局的最后:
<LinearLayout
android:layout_width="fill_parent"
android:gravity="center"
android:divider="@drawable/driver"<!--设置分割线样式-->
android:showDividers="middle"<!--设置分割线显示方式-->
android:layout_height="fill_parent"
android:orientation="horizontal">
<Button
android:id="@+id/bt1"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="1"/>
<Button
android:id="@+id/bt2"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="2"/>
<Button
android:id="@+id/bt3"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="3"/>
</LinearLayout>
示例4*显示分割线在这个布局的前后中间:
<LinearLayout
android:layout_width="fill_parent"
android:gravity="center"
android:divider="@drawable/driver"<!--设置分割线样式-->
android:showDividers="middle|beginning|end"<!--设置分割线显示方式-->
android:layout_height="fill_parent"
android:orientation="horizontal">
<Button
android:id="@+id/bt1"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="1"/>
<Button
android:id="@+id/bt2"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="2"/>
<Button
android:id="@+id/bt3"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="3"/>
</LinearLayout>

/**
* Set padding displayed on both ends of dividers.
*
* @param padding Padding value in pixels that will be applied to each end
*
* @see #setShowDividers(int)
* @see #setDividerDrawable(Drawable)
* @see #getDividerPadding()
*/

/ * *
*设置内边距显示分隔器的两端。
*
* @param内边距的值将会使用像素作为单位
*
* @see # setShowDividers(int)
* @see # setDividerDrawable(可移动)
* @see # getDividerPadding()
* /
public void setDividerPadding(int padding) {
mDividerPadding = padding;
}
android:dividerPadding="12dp"
3、
/**
* Whether the children of this layout are baseline aligned. Only applicable
* if {@link #mOrientation} is horizontal.
*/
@ViewDebug.ExportedProperty(category = "layout")
private boolean mBaselineAligned = true;
这种布局的子视图是否基线对齐。只适用水平布局--注:基线是在中间
xml代码只需要在LinearLayout布局中添加属性:
android:baselineAligned="true"
*{ @link # mOrientation }

If this layout is part of another layout that is baseline aligned,
* use the child at this index as the baseline.
*
* Note: this is orthogonal to {@link #mBaselineAligned}, which is concerned
* with whether the children of this layout are baseline aligned.
@ViewDebug.ExportedProperty(category = "layout")
*/
@ViewDebug.ExportedProperty(category = "layout")
private int mBaselineAlignedChildIndex = -1;
private int mBaselineAlignedChildIndex = -1;
如果这个布局是另一个基线对齐的布局的一部分,
*使用子视图在这个指数作为基准。
*
*注:这是正交于{ @link # mBaselineAligned },这是担心
*此布局的子视图是否基线对齐。
android:baselineAlignedChildIndex="-1"

/**
* When true, all children with a weight will be considered having
* the minimum size of the largest child. If false, all children are
* measured normally.
*
* @return True to measure children with a weight using the minimum
* size of the largest child, false otherwise.
*
* @attr ref android.R.styleable#LinearLayout_measureWithLargestChild
*/
public boolean isMeasureWithLargestChildEnabled() {
return mUseLargestChild;
}

/ * *
当为真的时候 具有相同权重/比重的所有子类被认为是最大子类的最小权重
如果为假 所有子类测量和平时权重/比重一样

android:measureWithLargestChild="true"

从今晚开始每晚翻译一点,贵在坚持。。。坚持大叔

和我一起看API(一)你所不知道的LinearLayout补充的更多相关文章

  1. 你所不知道的 CSS 阴影技巧与细节 滚动视差?CSS 不在话下 神奇的选择器 :focus-within 当角色转换为面试官之后 NPOI 教程 - 3.2 打印相关设置 前端XSS相关整理 委托入门案例

    你所不知道的 CSS 阴影技巧与细节   关于 CSS 阴影,之前已经有写过一篇,box-shadow 与 filter:drop-shadow 详解及奇技淫巧,介绍了一些关于 box-shadow  ...

  2. 你所不知道的linq(二)

    上一篇说了from in select的本质,具体参见你所不知道的linq.本篇说下from...in... from... in... select 首先上一段代码,猜猜结果是什么? class P ...

  3. 你所不知道的库存超限做法 服务器一般达到多少qps比较好[转] JAVA格物致知基础篇:你所不知道的返回码 深入了解EntityFramework Core 2.1延迟加载(Lazy Loading) EntityFramework 6.x和EntityFramework Core关系映射中导航属性必须是public? 藏在正则表达式里的陷阱 两道面试题,带你解析Java类加载机制

    你所不知道的库存超限做法 在互联网企业中,限购的做法,多种多样,有的别出心裁,有的因循守旧,但是种种做法皆想达到的目的,无外乎几种,商品卖的完,系统抗的住,库存不超限.虽然短短数语,却有着说不完,道不 ...

  4. 你所不知道的setInterval

    在你所不知道的setTimeout记载了下setTimeout相关,此篇则整理了下setInterval:作为拥有广泛应用场景(定时器,轮播图,动画效果,自动滚动等等),而又充满各种不确定性的这set ...

  5. 你所不知道的setTimeout

    JavaScript提供定时执行代码的功能,叫做定时器(timer),主要由setTimeout()和setInterval()这两个函数来完成.它们向任务队列添加定时任务.初始接触它的人都觉得好简单 ...

  6. 你真的会玩SQL吗?你所不知道的 数据聚合

    你真的会玩SQL吗?系列目录 你真的会玩SQL吗?之逻辑查询处理阶段 你真的会玩SQL吗?和平大使 内连接.外连接 你真的会玩SQL吗?三范式.数据完整性 你真的会玩SQL吗?查询指定节点及其所有父节 ...

  7. 你所不知道的SQL Server数据库启动过程,以及启动不起来的各种问题的分析及解决技巧

    目前SQL Server数据库作为微软一款优秀的RDBMS,其本身启动的时候是很少出问题的,我们在平时用的时候,很少关注起启动过程,或者很少了解其底层运行过程,大部分的过程只关注其内部的表.存储过程. ...

  8. 你所不知道的SQL Server数据库启动过程(用户数据库加载过程的疑难杂症)

    前言 本篇主要是上一篇文章的补充篇,上一篇我们介绍了SQL Server服务启动过程所遇到的一些问题和解决方法,可点击查看,我们此篇主要介绍的是SQL Server启动过程中关于用户数据库加载的流程, ...

  9. Android中Context详解 ---- 你所不知道的Context

    转自:http://blog.csdn.net/qinjuning/article/details/7310620Android中Context详解 ---- 你所不知道的Context 大家好,  ...

随机推荐

  1. html中如何添加提示信息

    提示:在标签中添加title属性 1.文本中如何添加提示信息? 1.1直接在标签中加title="值": 例如:<p title="爱笑,爱哭,爱生活"& ...

  2. MIP开发常见问题解答

    校验相关 1. MIP 页面的 <a>链接校验报错,MIP 是强制 target="_blank" 吗? 如果想直接跳转MIP页,可以用mip-link 组件:MIP ...

  3. Http状态码之:301、302重定向

    概念 301 Moved Permanently 被请求的资源已永久移动到新位置,并且将来任何对此资源的引用都应该使用本响应返回的若干个URI之一.如果可能,拥有链接编辑功能的客户端应当自动把请求的地 ...

  4. 使用 Nodejs 搭建简单的Web服务器

    使用Nodejs搭建Web服务器是学习Node.js比较全面的入门教程,因为要完成一个简单的Web服务器,你需要学习Nodejs中几个比较重要的模块,比如:http协议模块.文件系统.url解析模块. ...

  5. Android 问题汇总(持续更新)

    Q1:Error:(93, 12) 错误: 需要常量表达式 问题描述:这个问题是在添加一个module到项目中时遇到的,主要原因是因为原来module中的R文件是不会以final形式存在的,但是在mo ...

  6. Adaboost提升算法从原理到实践

    1.基本思想: 综合某些专家的判断,往往要比一个专家单独的判断要好.在"强可学习"和"弱科学习"的概念上来说就是我们通过对多个弱可学习的算法进行"组合 ...

  7. Javacript实现字典结构

    字典是一种用[键,值]形式存储元素的数据结构.也称作映射,ECMAScript6中,原生用Map实现了字典结构. 下面代码是尝试用JS的Object对象来模拟实现一个字典结构. <script& ...

  8. 真正的汉化-PowerDesigner 16.5 汉化

    一.背景 经常使用PowerDesigner,之前使用15版本,后来16出来后,就一直在使用16,不过一直是英文.一些同事对使用英文版总显示有些吃力. 遍寻百度.必应,都没有找到真正的针对版本16的汉 ...

  9. ExtJS 项目准备工作(一)

    首先,需要从网上下载两个文件,一个是SenchaCmd-6.2.0-windows-64bit(我的电脑是window 10 64位) 另一个是ExtJs6的源码包(ext-6.0.0.415). 源 ...

  10. MySQL常见面试题

    1. 主键 超键 候选键 外键 主 键: 数据库表中对储存数据对象予以唯一和完整标识的数据列或属性的组合.一个数据列只能有一个主键,且主键的取值不能缺失,即不能为空值(Null). 超 键: 在关系中 ...