文章目录
一、简介
-
控件一般指包括Button, TextView, EditView, ListView等,所有的控件都继承View类, 都是View的子类 .
-
另外扩展: 视图,控件,组件 的概念
二、官方控件
布局 | 描述 | 特点 / 应用 |
---|---|---|
TextView | 文本框 | |
Button | 按钮 | |
EditText | 编辑文本框 | |
ImageView | 图片 | |
ListView | 列表 | ListView 普通用法 ListView 定制界面 |
RecyclerView | 列表 | - |
ProgressBar /SeekBar | 进度条 | |
AlertDialog | 对话框 | - |
ProgressDialog | 进度对话框 | - |
CheckBox | 多选框控件 | - |
RadioButton | - | |
RadiioGroup | - | |
RatingBar | - | |
ImageButton | - | |
- |
- 另外,参考学习 《ListView 与 RecyclerView 的对比分析》文章对比 .
三、控件关系
四、控件详解
- TextView
-
效果
详解 TextView -
特别关注
- Button
- EditText
- ImageView
- ListView
- RecyclerView
- Recyclerview 是一个基于 support 包的控件,由于目前 androidx 已经取代了 supprot 包,因此在此推荐大家使用 Androidx 的包 .