Android基础UI控件
2017-07-26 16:05
239 查看
这只是常用的几个控件,还有第三方控件没有一一列出。
注意必须给控件设置宽高。
Button
TextView
EditText
CheckBox
RadioGroup,RadioButton
ImageView图片
ProgressBar
水平进度条 style=”?android:attr/progressBarStyleHorizontal”
2.一个大圆形样式 style=”?android:attr/progressBarStyleLarge”
3.小圆形样式 style=”?android:attr/progressBarStyleSmallTitle”
ProgressBar的详细使用
SeekBar拖动条
设置拖动条的条形形状
android:progressDrawable=”@mipmap/ic_launcher”
设置拖动条的拖动按钮
android:thumb=”@mipmap/ic_launcher”
详细使用解说
ListView条目
GridView九宫格
ViewPager
FrameLayout碎片
注意必须给控件设置宽高。
Button
<Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮"/>
TextView
<TextView android:id="@+id/textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="文字" android:textSize="25sp" android:textColor="@color/colorAccent"/>
EditText
<EditText android:id="@+id/edittext" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="输入框"/>
CheckBox
<CheckBox android:id="@+id/checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="多选框"/>
RadioGroup,RadioButton
<RadioGroup android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <RadioButton android:layout_weight="1" android:layout_width="match_parent" android:layout_height="wrap_content" android:button="@null" android:text="按钮1"/> <RadioButton android:layout_weight="1" android:layout_width="match_parent" android:layout_height="wrap_content" android:button="@null" android:text="按钮2"/> <RadioButton android:layout_weight="1" android:layout_width="match_parent" android:layout_height="wrap_content" android:button="@null" android:text="按钮3"/> </RadioGroup>
ImageView图片
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@mipmap/ic_launcher"/>
ProgressBar
水平进度条 style=”?android:attr/progressBarStyleHorizontal”
2.一个大圆形样式 style=”?android:attr/progressBarStyleLarge”
3.小圆形样式 style=”?android:attr/progressBarStyleSmallTitle”
ProgressBar的详细使用
<ProgressBar android:layout_width="match_parent" android:layout_height="wrap_content" style="?android:attr/progressBarStyleHorizontal" />
SeekBar拖动条
设置拖动条的条形形状
android:progressDrawable=”@mipmap/ic_launcher”
设置拖动条的拖动按钮
android:thumb=”@mipmap/ic_launcher”
详细使用解说
<SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" />
ListView条目
<ListView android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="wrap_content"/>
GridView九宫格
<GridView android:id="@+id/gridview" android:layout_width="match_parent" android:layout_height="wrap_content" android:numColumns="3"/>
ViewPager
<android.support.v4.view.ViewPager android:layout_width="match_parent" android:layout_height="match_parent"/>
FrameLayout碎片
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"/>
相关文章推荐
- Android UI基础——TextSwitcher&ImageSwitcher控件
- Android UI基础——SeekBar&RatingBar控件
- Android自定义UI实战(基础篇1)---组合控件封装
- Android UI基础——Toast控件
- Android学习之 UI--基础控件
- Android基础查缺补漏之UI控件
- Android UI基础 --基本控件
- Android 之路30---UI基础控件
- android一些常用基础UI控件(比较适合给新手参考)
- Android基础UI控件之Button
- 【Android基础】(7)UI控件(一)
- Android基础 基本UI控件运用的小例子
- Android基础 基本UI控件运用的小例子(2)
- Android基础UI控件之AutoCompleteTextView
- 【Android基础】(8)UI控件(二)
- Android 开发基础篇——UI——基础控件(TextView、Button、EditText)
- Android UI基础——CheckBox&RadioButton控件
- Android基础————UI控件以及控件事件处理详解
- Android基础————UI布局之高级控件详解
- 【Android基础】(9)UI控件(三)