博观而约取,厚积而薄发。这篇文章主要讲述 android控件-widgets相关的知识,希望能为你提供帮助。
1.TextView
类似,C#里的lable,显示一段文本

文章图片
< TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="TextView" />
2.Button

文章图片
< Button android:text="PDA" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/buttonPDA" android:layout_weight="1" />
3.ToggleButton
点击按钮 OFF ON切换

文章图片

文章图片
< ToggleButton android:id="@+id/toggleButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ToggleButton" />
4.CheckBox
复选框

文章图片
< CheckBox android:id="@+id/checkBox2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="CheckBox" />
5.RadioButton
单选框

文章图片
< RadioButton android:id="@+id/radioButton2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="RadioButton" />
6.CheckedTextView

文章图片

文章图片
< CheckedTextView android:id="@+id/checkedTextView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="多选风格" android:checkMark="?android:attr/listChoiceIndicatorMultiple" /> < CheckedTextView android:id="@+id/checkedTextView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="单选风格" android:checkMark="?android:attr/listChoiceIndicatorSingle" />
7.Spinner
下拉框

文章图片
< Spinner android:id="@+id/spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" />
8.ProgressBar
弧形进度条1

文章图片
< ProgressBar android:id="@+id/progressBar" style="?android:attr/progressBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" />
线型进度条2

文章图片
< ProgressBar android:id="@+id/progressBar3" style="?android:attr/progressBarStyleHorizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" />
9.SeekBar
滑动调节1

文章图片
< SeekBar android:id="@+id/seekBar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" />
文章图片
滑动调节2
< SeekBar android:id="@+id/seekBar2" style="@style/Widget.AppCompat.SeekBar.Discrete" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:max="10" android:progress="3" />
10.QuickContactBadge
联系人
11.RatingBar
打分

文章图片
< RatingBar android:id="@+id/ratingBar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" />
【android控件-widgets】12.Switch
滑动开关

文章图片
< Switch android:id="@+id/switch1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Switch" />
13.Space
推荐阅读
- android布局控件
- android控件-images
- (10) android控件-date
- android studio 使用基础
- android控件-Containers
- @EnableAutoConfiguration和@SpringbootApplication注解
- Maven Webapp项目web.xml版本记录
- 定制APP三步走
- APP定制开发的准备事项