TextView
用于向用户显示文字
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/save"/>
Button
按钮控件
<Button android:id="@+id/btnSave"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/save"
android:onClick="btnSaved_clicked"/>
ImageButton
按钮控件,可以展示图片
<ImageButton android:id="@+id/btnImg1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
style属性的格式如下:
?[package:][type:]name
EditText
TextView的子视图,用户可以编辑内容,
当在EditText中输入文字时候,他的宽度会自动变化
<EditText android:id="@+id/txtName"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
CheckBox
具有2个状态的特殊按钮类型:选中或未选中
<CheckBox android:id="@+id/chkAutosave"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Autosave" />
RadioGroup和RadioButton
RadioButton有2种状态:选中未选中
RadioGroup用来把一个或多个RadioButton组合在一起,每次只能有一个RadioButton被选中
<RadioGroup android:id="@+id/rdbGp1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton android:id="@+id/rdb1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Option 1" />
<RadioButton android:id="@+id/rdb2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Option 2" />
</RadioGroup>
ToggleButton
用一个灯光 指示器来显示选中/未选中状态
<ToggleButton android:id="@+id/toggle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
ProgressBar
提供了一个正在进行的任务的视觉反馈
<ProgressBar android:id="@+id/progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/Widget.ProgressBar.Horizontal" />
AutoCompleteTextView
是一种与EditText类似的视图(实际上他是EditText的子类),只不过它还在用户输入时自动显示完成建议的列表
<AutoCompleteTextView android:id="@+id/txtCountries"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
textView.setThreshold(3); //显示下拉菜单用户必须输入的最小字符个数
TimePicker
可以按24小时或者AM/PM模式选择时间
<TimePicker android:id="@+id/timePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
DatePicker
选择指定日期
<DatePicker android:id="@+id/datePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
ListView
在一个垂直滚动列表中显示列表项列表,扩展ListActivy类并且绑定数据源
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
Spinner
一次显示列表中的一项,点击可以展示所有列表,选中之后隐藏列表,展示选择的数据项
<Spinner
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true" />
特殊碎片
- ListFragment
- DialogFragment
- PreferneceFragment
Gallery
是一种固定在中间位置的水平滚动列表显示列表项(如图片),目前已经废弃
ImageSwitcher
图片选择器
GridView
在一个二维的滚动网络中来显示项
AnalogClock
显示一个有2个指针(时针和分针)模拟时钟
DigitalClock
数字的方式显示时钟
WebView
加载网页控件
分享到:
相关推荐
第1章 Android入门 1 1 关于Android的非技术问题 1 1 1 为什么看好 Android 1 1 2 以前是否从事过Android的工作 做过哪些工作 1 1 3 你做的最复杂的界面是什么 1 1 4 如何解决Android学习中遇到的难题 1 1 5 Android...
《Android自定义控件开发入门与实战》高清影印版,带目录,拒绝压缩包加密坑钱,内容深入浅出,对于有Android自定义开发需求的非常有帮助
Android自定义控件开发入门与实战从自定义基础到实战的讲解。一步步深入。适合有一定Android基础的读者。本压缩包中自带了推荐的pdf阅读器。大家要是喜欢这本文档,推荐去京东,天猫,当当买支持一下默默付出的作者...
Android入门学习笔记,Android基础及UI、各种控件的使用,以及各种基本应用
android入门级视频:Android基本组件介绍之Android应用的灵魂——Intent和Activity介绍与实例
本人学习android入门时重写的一套代码,包括button,edittext,optionmenu,tab等基本控件的用法,以及一个语音识别的简单示例
《Android自定义控件开发入门与实战》从自定义控件的动画、绘图、视图三方面入手,分别讲解与自定义控件相关的各种知识,给大家系统地梳理相关知识点,并且通过翔实的案例讲解每个知识点在现实工作中所能实现的功能...
android入门 PPT学习 控件 ListView GridView Intent ContentProvider
《Android自定义控件入门到实战》源码
入门级自定义控件Demo,可以帮助初学者了解自定控件的基本过程,为以后的发展奠定基础
Android GUI 基本控件简易用法 参照“Android 5 从入门到精通(李波 主编)”,基于Android Studio 2.2.3 开发平台
这是我写的 Android 自定义控件入门 这个小教程的例子源码,十分基础,用了同一个例子的不同写法和扩展,简单明了的讲解了View的重写,教程请去我的博客,地址为:...希望大家能通过简单的例子学到东西,举一反三。...
安卓Android源码——自定义控件入门级demo.zip
第7章 良好的学习开端——Android基本组件介绍 7.1 第一印象很重要——界面UI元素介绍 7.1.1 视图组件(View) 7.1.2 视图容器组件(Viewgroup) 7.1.3 布局组件(Layout) 7.1.4 布局参数(LayoutParams) 7.2 我的美丽我...
完整的android 安卓入门demo,包含了所有的控件、服务及广播等等,看完想不会都难
NULL 博文链接:https://fuchangle.iteye.com/blog/1838394
Android_菜单(Menu)控件的使用.pdf入门非常好的帮手 一步一步跟着做就学会安卓开发了
Android高级应用源码-自定义控件入门级demo.zip
因为ListView只能显示一级列表,如果实现像QQ好友列表那样的效果,就需要用到ExpandableListView,入门新手可能对该控件不是很熟悉,通过本Android源码你将了解一下基本用法,其实跟ListView差不多。 注:测试时...
来自官网的源码,直接下载后搬运到这里,