|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
|
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
you may not use this file except in compliance with the License.
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
See the License for the specific language governing permissions and
|
|
|
limitations under the License.
|
|
|
-->
|
|
|
|
|
|
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
|
|
|
android:layout_width="fill_parent"
|
|
|
android:layout_height="fill_parent"
|
|
|
android:orientation="vertical"
|
|
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
|
<!--
|
|
|
1、layout文件是界面或控件的布局资源,布局资源是XML文件,根元素是ViewGroup(一个布局容器,包含多个View对象,如文本,按钮,或作为View
|
|
|
对象的子布局等等)或View,布局容器有多种类型,如线性布局相对布局等等
|
|
|
2、该布局XML文件的布局容器为线性布局,线性布局是水平或垂直的,方向由LinearLayout的android:orientation属性设置
|
|
|
3、android:layout_width属性 指定了布局的宽度 属性值可以是尺寸单位或关键字(match_parent 替代fill_parent 尺寸与父元素一样
|
|
|
warp_content 包装内容,尺寸大小适配内容大小 等等) 该元素尺寸是适配父元素
|
|
|
4.android:layout_height属性 指定的布局的高度
|
|
|
5、android:orientation属性 指定线性布局是水平还是垂直 vertical指定垂直
|
|
|
-->
|
|
|
|
|
|
<TextView
|
|
|
android:id="@+id/account_dialog_title"
|
|
|
style="?android:attr/textAppearanceMedium"
|
|
|
android:singleLine="true"
|
|
|
android:ellipsize="end"
|
|
|
android:gravity="center"
|
|
|
android:layout_marginTop="-2.7dip"
|
|
|
android:layout_marginBottom="-2.7dip"
|
|
|
android:layout_width="fill_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
tools:ignore="VisualLintBounds" />
|
|
|
<!--
|
|
|
1、TextView元素声明了一个向用户显示文本的view子类,不能被用户编辑,要编辑则为EditText
|
|
|
2、android:id属性 指定了该view对象资源的id,用于引用,属性值为 @+id/名字 +代表如果该id不在id文件里,则新建一个id
|
|
|
3、style属性 是对安卓预定义样式的引用,属性值为你要引用的样式,当前是文本外观中等
|
|
|
4、android:singleLine属性 指定了文本是否单行显示,已废弃,使用lines属性
|
|
|
5、android:ellipsize属性 指定了省略号在那个位置显示,ellipsize是拼写错误
|
|
|
6、android:gravity属性 指定了该控件里的元素的对齐方式,当前是横纵居中
|
|
|
7、android:layout_marginTop属性 指定了上外边距的大小,即与父组件上边界的距离,当前属性值为负数,则该view对象的上边距在父组件里,
|
|
|
有一部分重叠,用于遮盖
|
|
|
8、android:layout_marginBottom属性 指定了下外边距的大小,即与父组件下边界的距离,值为负,则与父组件有重叠
|
|
|
9、android:layout_width属性 当前指定该view的宽与父组件一样,android:layout_height属性 指定当前的高于内容相适配
|
|
|
-->
|
|
|
|
|
|
<TextView
|
|
|
android:id="@+id/account_dialog_subtitle"
|
|
|
android:layout_width="fill_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_marginTop="5dip"
|
|
|
android:layout_marginBottom="1dip"
|
|
|
android:gravity="center"/>
|
|
|
<!--
|
|
|
1、声明了一个显示文本的view对象,id指定为account_dialog_subtitle,当id文件中没有时新建
|
|
|
2、指定宽与父组件一样,高于内容匹配
|
|
|
3、指定了上外边距为5dip,下外边距为1dip
|
|
|
4、指定了该控件里的内容的对齐方式为横纵居中
|
|
|
-->
|
|
|
|
|
|
</LinearLayout> |