失效链接处理 |
Android UI 基础知识 PDF 下蝲
本站整理下蝲Q?nbsp;
链接Q?a target="_blank">https://pan.baidu.com/s/19H8Dp6B9vMJvWRFVQgrZXQ
提取码:jkpq
相关截图Q?/strong>
![]()
主要内容Q?/strong>
W四?Android UI 基础知识
目标
了解Android UI
布局
常用UI控g
写一个简单UI目
01 Android UI
1.1 UI
用户界面QUser InterfaceQ简U?UIQ亦UC用者界面)是系l和用户之间q行交互和信息交?/div>
的媒介,它实C息的内部形式与hcd以接受Ş式之间的转换?/div>
软g设计可分Z个部分:~码设计与UI设计?/div>
1.2 Android UI
Android应用界面包含用户可查看ƈ与之交互的所有内宏VAndroid 提供丰富多样的预|?UI l?Ӟ例如l构化布局对象?UI 控gQ?zhn)可以利用q些lg为?zhn)的应用构建图形界面。Android q?/div>
提供其他界面模块Q用于构建特D界面,例如对话框、通知和菜单?/div>
Android UI 都是由布局和控件组成的
02 布局
布局(layout)可定义应用中的界面结构(例如 Activity 的界面结构)。布局中的所有元素均使用 View ?ViewGroup 对象的层ơ结构进行构建。View 通常l制用户可查看ƈq行交互的内宏V然而,
ViewGroup 是不可见容器Q用于定?View 和其?ViewGroup 对象的布局l构?/div>
2.1 布局的结?/div>
定义界面布局的视囑ֱơ结构图C?
View 对象通常UCؓ“微g”Q可以是众多子类之一Q例?Button ?TextView ?ViewGroup 对象通常UCؓ“布局”Q可以是提供其他布局l构的众多类型之一Q例?/div>
LinearLayout ?ConstraintLayout ?/div>
2.2 声明布局
?XML 中声明界面元素,Android 提供对应 View cd其子cȝ?XML 词汇Q如用于微g和布
局的词汇?/div>
(zhn)也可?Android Studio ?Layout EditorQƈ采用拖放界面来构?XML 布局?/div>
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
|