You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitProject1/doc/向金成——精读代码/layout/account_dialog_title.xml

71 lines
4.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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>