常用控件
在Android 中使用各种控件(View)
●TextView - 文本显示控件
●Button - 按钮控件
●EditText-
●ImageButton - 图片按钮控件
●ImageView - 图片显示控件
●CheckBox - 复选框控件
●RadioButton - 单选框控件
●AnalogClock - 钟表(带表盘的那种)控件
●DigitalClock - 电子表控件
●ToggleButton-开关按钮控件
1、TextView
类似https://www.wendangku.net/doc/986840929.html,中的Label控件,只读显示控件,可通过getText()获取其android:text属性、setText()设置其android:text属性。在res/layout/main.xml的LinearLayout节中添加如下代码来声明TextView。
TextView android:layout_ width="fill_parent" android:layout_border="1" height="wrap_content" android:text="@string/hello" android:id="@+id/myTextView" /> 在java代码中可以通过下列代码取得该控件。
1 //取得该控件
2 TextView myTextView =(TextView)findViewById(R.id.myTextView);
TextView 的Demo
textview.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< !--
TextView - 文本显示控件
-->
< TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/textView" />
< /LinearLayout>
_TextView.Java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class _TextView extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.textview);
// 设置Activity 的标题
setTitle("TextView");
TextView txt = (TextView) this.findViewById(R.id.textView);
// 设置文本显示控件的文本内容,需要换行的话就用“”
txt.setText("我是TextView 显示文字用的");
}
}
2、Button
按钮控件,用户通过该控件来提交自己的请求,是用户与应用程序交互的最常用控件之一。
1)普通按钮
在res/layout/main.xml中声明控件
Button android:layout_ width="wrap_content" android:layout_border="1" height="wrap_content" android:id="@+id/myButton" />
2)用户自定义按钮
用户自定义按钮在很大程度上满足了用户个性化的要求。在这儿创建一个用图片代替普通文字的按钮。
首先把图片复制进res/drawable*文件夹(三个文件夹都需要);然后再同一个文件夹中创建一个my_button.xml用户定义我们的格式选择文件;
xml version="1.0" encoding=""?>
selector xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android">
item android:drawable="@drawable/hmenulock"
android:state_pressed="true" />
item android:drawable="@drawable/hmenuunlock"
android:state_focused="true" />
item android:drawable="@drawable/hmenuunlock" />
selector>
当my_button.xml文件被引用后,上面的item的顺序就非常的重要了。因为在进行匹配时,android:state_pressed和switch的case一样,只要有一个item匹配成功,后面的就将不再进行下去。
最后在res/layout/main.xml中引用我们刚才定义的my_button.xml。1 Button android:layout_ width="wrap_content" android:layout_border="1" height="wrap_content" android:background="@drawable/my_button" android:id="@+id/myButton" /> android:background=”@drawable/my_button”定义了引用的背景选择文件来自drawable 文件夹的my_button.xml。
上面简单的介绍了如何定义一个普通Button和自定义格式的Button。那么如何响应用户的动作呢?
//响应Button的Click事件
myButton = (Button) findViewById(R.id.myButton);
myButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Toast.makeText(Android_Control_DemoActivity.this,
"click Button", Toast.LENGTH_SHORT).show();
}
});
Button 的Demo
button.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/textView" />
< !--
Button - 按钮控件
-->
< Button android:id="@+id/button"
android:layout_width="wrap_content" android:layout_height="wrap_content"> < /Button>
< /LinearLayout>
_Button.java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class _Button extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.button);
setTitle("Button");
Button btn = (Button) this.findViewById(R.id.button);
btn.setText("click me");
// setOnClickListener() - 响应按钮的鼠标单击事件
btn.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v) {
TextView txt = (TextView) _Button.this.findViewById(R.id.textView);
txt.setText("按钮被单击了");
}
});
}
}
3、EditText
Android系统提供给用户输入的文本框,如https://www.wendangku.net/doc/986840929.html,中TextBox。 EditView类继承自TextView类,EditView与TextView最大的不同就是用户可以对EditView控件进行编辑,同时还可以为EditView控件设置监听器,用来判断用户的输入是否合法。
EditText的Demo
editText.xml
代码
EditText android:layout_ width="fill_parent" android:layout_border="1" height="wrap_content" android:id="@+id/myEditText" />
让我们的EditText一个回车动作,请看下面的代码,代码里演示了如何取得EditText的值以及如何为TextView赋值。
//操作EditText控件,取值以及响应事件
myEditText = (EditText)findViewById(R.id.myEditText);
myEditText.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// 响应用户的回车键动作,将EditText中值显示到TextView中
if ((event.getAction() == KeyEvent.ACTION_DOWN) &&(keyCode == KeyEvent.KEYCODE_ENTER)) {
myTextView.setText(myEditText.getText());
return true;
}
return false;
}
});
4、ImageButton
除了可以使用Android系统自带的Button(按钮)外,在Android平台中,我们还可以制作带图标的按钮,这就需要使用ImageButton组件鸟
要制作带图标的按钮,首先要在布局文件中定义ImageButton,然后通过setImageDrawable方
法来设置按钮要显示的图标。同样需要对按钮设置事件监听setOnClickListener,以此来捕捉事件并处理。
ImageButton 的Demo
imagebutton.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/textView" />
< !--
ImageButton - 图片按钮控件
-->
< ImageButton android:id="@+id/imageButton"
android:layout_width="wrap_content" android:layout_height="wrap_content">
< /ImageButton>
< /LinearLayout>
_ImageButton.java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
public class _ImageButton extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.imagebutton);
setTitle("ImageButton");
ImageButton imgButton = (ImageButton) this.findViewById(R.id.imageButton);
// 设置图片按钮的背景
imgButton.setBackgroundResource(R.drawable.icon01);
// setOnClickListener() - 响应图片按钮的鼠标单击事件
imgButton.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v) {
TextView txt = (TextView) _ImageButton.this.findViewById(R.id.textView);
txt.setText("图片按钮被单击了");
}
});
}
}
5、ImageView
ImageView用来显示任意图像图片,可以自己定义显示尺寸,显示颜色等等.
android:adjustViewBounds 是否保持宽高比。需要与maxWidth、MaxHeight一起使用,单独使用没有效果。
android:cropToPadding 是否截取指定区域用空白代替。单独设置无效果,需要与scrollY 一起使用
android:maxHeight 定义View的最大高度,需要与AdjustViewBounds一起使用,单独使用没有效果。如果想设置图片固定大小,又想保持图片宽高比,需要如下设置:1)设置AdjustViewBounds为true;
2)设置maxWidth、MaxHeight;
3)设置设置layout_width和layout_height为wrap_content。
android:maxWidth 设置View的最大宽度。
android:scaleType 设置图片的填充方式。
android:src 设置View的图片或颜色
android:tint 将图片渲染成指定的颜色。
使用Martix(android.graphics.Matrix)类中的postScale()方法结合Bitmap来实现缩放图片的功能
Bitmap bmp = BitmapFactory.decodeResource(getResource(),R.drawalbe.icon1)
int bmpwidth = bmp.getWidth();
int bmpheight = bmp.getHeight();
Matrix matrix = new Matrix();
matrix.postScale(width,height);
Bitmap bm = Bitmap.createBitmap(bmp,0,0,bmpwidth,bmpheight ,matrix,true);
imageView.setImageBitmap(bm);
在Android中不允许ImageView在产生后,动态修改其长度和宽度,
所以要实现图片发大缩小的功能,必须将原来的ImageView移除,
重新产生一个新的ImageView,并且指定图片来源给它,再放入Layout中。ImageView 的Demo
imageview.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< !--
ImageView - 图片显示控件
-->
< ImageView android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content">< /ImageView>
< /LinearLayout>
_ImageView.java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
public class _ImageView extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.imageview);
setTitle("ImageView");
ImageView imgView = (ImageView) this.findViewById(R.id.imageView);
// 指定需要显示的图片
imgView.setBackgroundResource(R.drawable.icon01);
}
}
6、CheckBox
复选按钮。在应用程序中如果让用户选择自己的喜好时,因为用户的喜好不可能只有一个,所以这时你必须使用复选按钮,允许用户多选。
在res/layout/main.xml中声明控件。
1 CheckBox android:text="CheckBox" android:id="@+id/checkBox1" android:layout_ width="wrap_content" android:layout_border="1" height="wrap_content">CheckBox> 下面来响应用户的选择操作,通常情况下,复选框选择后是有一个按钮来统一提交的,但是我们在例子中只演示如何响应CheckBox的Change事件。
//为myChecBox控件绑定响应事件
myCheckBox = (CheckBox)findViewById(R.id.checkBox1);
myCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
{
Toast.makeText(Android_Control_DemoActivity.this, myCheckBox.getText(), Toast.LENGTH_SHORT).show();
}
}
});
CheckBox 的Demo
checkbox.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/textView" />
< !--
CheckBox - 复选框控件
-->
< CheckBox android:text="CheckBox01" android:id="@+id/chk1"
android:layout_width="wrap_content" android:layout_height="wrap_content">< /CheckBox>
< CheckBox android:text="CheckBox02" android:id="@+id/chk2"
android:layout_width="wrap_content" android:layout_height="wrap_content">< /CheckBox>
< CheckBox android:text="CheckBox03" android:id="@+id/chk3"
android:layout_width="wrap_content" android:layout_height="wrap_content">< /CheckBox>
< /LinearLayout>
_CheckBox.java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CheckBox;
import https://www.wendangku.net/doc/986840929.html,poundButton;
import android.widget.TextView;
public class _CheckBox extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.checkbox);
setTitle("CheckBox");
CheckBox chk = (CheckBox) this.findViewById(R.id.chk1);
// setOnCheckedChangeListener() - 响应复选框的选中状态改变事件
chk.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
TextView txt = (TextView) _CheckBox.this.findViewById(R.id.textView);
txt.setText("CheckBox01 的选中状态:" + String.valueOf(isChecked));
}
});
}
}
7、RadioButton
单选按钮,放在一个RadioGroup中,在这个group中只能有一个选项能够被选中,比如你选择性别时,只能选择一个性别。
为了响应RadioButton的选择动作,我们可以有两种方式。
A、定义单独的一个myClickListener监听器,然后为每一个Radio注册这个监听器。
//1、定义一个我们自己的myClickListener监听器,事件类型为OnClickListener
OnClickListener myClickListener=new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
RadioButton r=(RadioButton)v;
Toast.makeText(Android_Control_DemoActivity.this, r.getText(), Toast.LENGTH_SHORT).show();
}
};
final RadioButton radio_1=(RadioButton)findViewById(R.id.radio0);
final RadioButton radio_2=(RadioButton)findViewById(R.id.radio1);
final RadioButton radio_3=(RadioButton)findViewById(R.id.radio2);
radio_1.setOnClickListener(myClickListener);
radio_2.setOnClickListener(myClickListener);
radio_3.setOnClickListener(myClickListener);复制代码
B、为RadioGroup绑定事件,在这个事件中判断选择的按钮ID来响应事件。
//2、使用RadioGroup的CheckedChange方法来监听我们的RadioButton的点击事件
myRadioGroup =(RadioGroup)findViewById(R.id.radioGroup1);
myRadioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
// TODO Auto-generated method stub
{
Toast.makeText(Android_Control_DemoActivity.this, radio_1.getText(), Toast.LENGTH_SHORT).show();
}
if (radio_2.getId()==checkedId)
{
Toast.makeText(Android_Control_DemoActivity.this, radio_2.getText(), Toast.LENGTH_SHORT).show();
}
{
Toast.makeText(Android_Control_DemoActivity.this, radio_3.getText(), Toast.LENGTH_SHORT).show();
}
}
});
以上两种方法有什么区呢?A方法是只要你点击单选按钮系统就会响应,而不管你点击的是否为同一个RadioButton,B方法只会响应不同的单选动作,如果在同一个RadioButton上重复点击,系统是不会响应的。
RadioButton 的Demo
radiobutton.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/textView" />
< !--
RadioButton - 单选框控件
RadioGroup - 对其内的单选框控件做分组
checkedButton - 指定组内被选中的单选框的ID
-->
< RadioGroup android:id="@+id/radioGroup"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:checkedButton="@+id/rad3" android:orientation="horizontal"
android:gravity="center_vertical|center_horizontal">
< RadioButton android:text="rad1" android:id="@+id/rad1"
android:layout_width="wrap_content" android:layout_height="wrap_content">< /RadioButton>
< RadioButton android:text="rad2" android:id="@+id/rad2"
android:layout_width="wrap_content" android:layout_height="wrap_content">< /RadioButton>
< RadioButton android:text="rad3" android:id="@+id/rad3"
android:layout_width="wrap_content" android:layout_height="wrap_content">< /RadioButton>
< /RadioGroup>
< /LinearLayout>
_RadioButton.java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
public class _RadioButton extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.radiobutton);
setTitle("RadioButton");
RadioGroup group = (RadioGroup) this.findViewById(R.id.radioGroup);
// setOnCheckedChangeListener() - 响应单选框组内的选中项发生变化时的事件group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
TextView txt = (TextView) _RadioButton.this.findViewById(R.id.textView);
txt.setText(((RadioButton)findViewById(checkedId)).getText() + " 被选中");
}
});
}
}
8、AnalogClock
这是一个带有时针和分针的模拟时钟控件。
AnalogClock 的Demo
analogclock.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< !--
AnalogClock - 钟表(带表盘的那种)控件
-->
< AnalogClock android:id="@+id/analogClock"
android:layout_width="wrap_content" android:layout_height="wrap_content"> < /AnalogClock>
< /LinearLayout>
_AnalogClock.java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
public class _AnalogClock extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.analogclcok);
setTitle("AnalogClock");
}
}
9、DigitalClock
DigitalClock只需要在布局文件中,用于显示时间的地方使用此组件即可,无需用java 代码进行实例化。DigitalClock并没有设置输出格式的属性或方法,但是可以通过继承重写来实现,
DigitalClock 的Demo
digitalclock.xml
代码
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="https://www.wendangku.net/doc/986840929.html,/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
< !--
DigitalClock - 电子表控件
-->
< DigitalClock android:id="@+id/digitalClock"
android:layout_width="wrap_content" android:layout_height="wrap_content">
< /DigitalClock>
< /LinearLayout>
_DigitalClock.java
代码
package com.webabcd.view;
import android.app.Activity;
import android.os.Bundle;
public class _DigitalClock extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(https://www.wendangku.net/doc/986840929.html,yout.digitalclcok);
setTitle("DigitalClcok");
}
}
10、ToggleButton
如果有用过android系统的人都知道,在开启和关闭WIFI的时候,有一个按钮,当你开启WIFI时按钮显示为On,当你关闭WIFI时按钮显示为OFF,这个按钮只有这两种状态。这个按钮就是ToggleButton。
ToggleButton的Demo
toggleButton.xml
ToggleButton android:text="ToggleButton" android:id="@+id/toggleButton1" android:layout_ width="wrap_content" android:layout_border="1" height="wrap_content" android:textOn="On" android:textOff="Off">ToggleButton>
android:textOn当在打开状态时,显示在这个按钮上的文字android:textOff当在关闭状态时,显示在这个按钮上的文字
响应Toggle Button的Checked事件
//响应myToggleButton的Checked事件
myToggleButton = (ToggleButton)findViewById(R.id.toggleButton1);
myToggleButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
{
Toast.makeText(Android_Control_DemoActivity.this, myToggleButton.isChecked()+"", Toast.LENGTH_SHORT).show();
}
}
});
android studio 控件常用属性 下面是RelativeLayout各个属性 1.android:layout_above="@id/xxx" --将控件置于给定ID控件之上 2.android:layout_below="@id/xxx" --将控件置于给定ID控件之下 3. android:layout_toLeftOf="@id/xxx" --将控件的右边缘和给定ID控件的左边缘对齐 4.android:layout_toRightOf="@id/xxx" --将控件的左边缘和给定ID控件的右边缘对齐 5. android:layout_alignLeft="@id/xxx" --将控件的左边缘和给定ID控件的左边缘对齐 6.android:layout_alignTop="@id/xxx" --将控件的上边缘和给定ID控件的上边缘对齐 7.android:layout_alignRight="@id/xxx" --将控件的右边缘和给定ID控件的右边缘对齐 8.android:layout_alignBottom="@id/xxx" --将控件的底边缘和给定ID控件的底边缘对齐 9.android:layout_alignParentLeft="true" --将控件的左边缘和父控件的左边缘对齐 10. android:layout_alignParentTop="true" --将控件的上边缘和父控件的上边缘对齐 11. android:layout_alignParentRight="true" --将控件的右边缘和父控件的右边缘对齐 12.android:layout_alignParentBottom="true" --将控件的底边缘和父控件的底边缘对齐 13.android:layout_centerInParent="true" --将控件置于父控件的中心位置 14.android:layout_centerHorizontal="true" --将控件置于水平方向的中心位置 15.android:layout_centerVertical="true" --将控件置于垂直方向的中心位置 android:layout_width 设置组件的宽度 android:layout_height 设置组件的高度 android:id 给组件定义一个id值,供后期使用 android:background 设置组件的背景颜色或背景图片 android:text 设置组件的显示文字 android:textColor 设置组件的显示文字的颜色 android:layout_below 组件在参考组件的下面 android:alignTop 同指定组件的顶平行
任务一 Android开发环境的搭建 第一部分知识回顾与思考 1.Android的四层架构分别包括哪几层分别起到什么作用 答:Linux内核层(Linux Kernel):基于Linux内核,内核为上层系统提供了系统服务。 系统库层(Libraries):系统库基于C/C++语言实现,通过接口向应用程序框架层提供编程接口。 应用框架层(Application Framework):为开发者提供了一系列的Java API,包括图形用户界面组件View、SQLite数据库相关的API、Service组件等。 应用程序层(Applications):包含了Android平台中各式各样的应用程序。 第二部分职业能力训练 一、单项选择题(下列答案中有一项是正确的,将正确答案填入括号内) 1.Android四层架构中,应用框架层使用的是什么语法( C ) A.C B.C++ C.Java D.Android 2.Android四层架构中,系统库层使用的是什么语法( B ) A.VB B.C /C++ C.Java D.Android 3.应用程序员编写的Android应用程序,主要是调用( B )提供的接口进行实现。 A.应用程序层 B.应用框架层 C.应用视图层 D.系统库层 二、填空题(请在括号内填空) 1.在Android智能终端中,有很多应用如拍照软件、联系人管理软件,它们都属于Android的(应用程序)层。 2.为了让程序员更加方便的运行调试程序,Android提供了(模拟器),可以方便的将程序运行其上,而不要实际的移动终端。 3.为了支持Java程序运行,我们需要安装(JDK)。 三、简答题 1.简述Android开发环境安装的步骤。 答:下载并安装JDK,配置JDK的环境变量; 从Anroid官网上下载Android开发组件(包含Eclipse和Android SDK、ADT); 安装Android开发环境(包括配置Android SDK的环境变量、打开Eclipse通过菜单设定Android SDK 路径)。 2.简述Android应用程序创建和运行的步骤。 答:通过菜单创建Android应用程序,设置应用程序名、Android版本等基本信息。
《Android基础应用》 Android常用控件 ?本章任务 ?使用Android开发使用时间组件 ?使用Android开发使用进度条组件 ?使用Android开发创建底部选项卡 ?本章目标 ?了解Android的组件层次结构 ?掌握常用的日期时间类控件 ?掌握常用的几个容器组件 1.Android组件的层次结构 UI组件都是View的子类,View有很多子类,它们之间存在树状的继承关系View及其子类结构图
TextView及其子类结构图
ViewGroup及其子类结构图 其下的子类一般作为容器或布局来使用 FrameLayout及其子类结构图 其下的子类通常作为容器或布局来使用
2.时间控件 2.1日期时间选择器 DatePicker组件可用于输入日期,TimePicker组件可用来选择时间,只能输入小时和分,默认12小时制 DatePicker ●使用onDateChangedListener监听器来获取用户的日期选择 ●使用init对组件进行初始化 ●使用getYear,getMonth,getDayOfMonth方法获得用户选择的年,月,日 TimePicker ●使用onTimeChangedListener监听器获取用户的时间选择 ●使用setIs24HourView设置是否以24小时制显示 ●使用getCurrentHour获得当前的小时数 ●使用getCurrentMinute获得当前的分钟数 示例
示例的实现结果
2.2时钟组件 AnalogClock组件用来以表盘的方式显示当前时间,该表只有时针和分针,DigitClock组件以数字的方式显示当前时间可以显示时分秒,由于DigitClock继承TextView,可以使用TextView 的属性 示例
今天我用自己写的一个Demo 和大家详细介绍一个Android开发中遇到的一些常用系统控件的使用技巧。 1.文本框TextView TextView的作用是用来显示一个文本框,下面我用两种方式为大家呈现TextView,第一种是通过xml布局文件
呈现,第二种是通过代码来呈现,由此可见Android 的界面开发真的是非常灵活。 view plaincopy to clipboardprint? 1. public class TextViewActivity extends Activity { 2. @Override 3. protected void onCreate(Bundle savedInstanceState) { 4. setContentView(https://www.wendangku.net/doc/986840929.html,yout.textview);
5. 6. LinearLayout ll = (LinearLayout) findViewById(R.id.textviewll); 7. TextView textView = new TextView(this); 8. //设置显示文字 9. textView.setText("从代码中添加一个TextView"); 10. //设置显示颜色 11. textView.setTextColor(Color.WHITE); 12. //设置显示字体大小 13. textView.setTextSize(18); 14. //设置显示背景颜色 15. textView.setBackgroundColor(Color.BLUE); 16. //设置锚点位置 17. textView.setGravity(Gravity.CENTER_VERTICAL|Gravity.CE NTER_HORIZONTAL); 18. //把这个view加入到布局当中 19. ll.addView(textView); 20. 21. super.onCreate(savedInstanceState); 22. } 23. } 1. 2. android常用控件大全 在Android中使用各种控件(View) DatePicker-日期选择控件 TimePicker-时间选择控件 ToggleButton-双状态按钮控件 EditText-可编辑文本控件 ProgressBar-进度条控件 SeekBar-可拖动的进度条控件 AutoCompleteTextView-支持自动完成功能的可编辑文本控件 MultiAutoCompleteTextView-支持自动完成功能的可编辑文本控件,允许输入多值(多值之间会自动地用指定的分隔符分开) ZoomControls-放大/缩小按钮控件 Include-整合控件 VideoView-视频播放控件 WebView-浏览器控件 RatingBar-评分控件 Tab-选项卡控件 Spinner-下拉框控件 Chronometer-计时器控件 ScrollView-滚动条控件 在Android中使用的Layout FrameLayout:里面只可以有一个控件,并且不能设计这个控件的位置,控件会放到左上角 LinearLayout:里面可以放多个控件,但是一行只能放一个控件 TableLayout:这个要和TableRow配合使用,很像html里面的table AbsoluteLayout:里面可以放多个控件,并且可以自己定义控件的x,y的位置 RelativeLayout:里面可以放多个控件,不过控件的位置都是相对位置 (Android界面布局好像还可以直接引用一些view,如ScrollView等) 常用控件: 1,EditText 主要函数:setText/getText设置/获取文本内容,setHint设置缺省显示内容; 2,RadioGroup,RadioButton RadioButton的isChecked()判断是否被选中 获取选中RadioButon的ID:设置 RadioGroup.setOnCheckedChangeListener方法 publiconCheckedChanged(RadioGroupgroup,intcheckedId)//checkedId 是选中RadioButton的ID 3,CheckBox isChecked()判断是否被选中 setOnCheckedChangeListener方法监视选中状态改变情况 4,Spinner a,显示数据 1),硬编码加载 通过setAdapter方法设置类型为 ArrayAdapter(Contextcontext,inttextViewResId,String[]objects) textViewResourceId:显示内容的ViewID默认设置为 https://www.wendangku.net/doc/986840929.html,yout.simple_spinner_item Android开发日志—常用控件篇(容器控件) android简介: Android是一种基于Linux的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑,由Google公司和开放手机联盟领导及开发。尚未有统一中文名称,中国大陆地区较多人使用“安卓”或“安致”。Android操作系统最初由Andy Rubin开发,主要支持手机。 Android的系统架构和其操作系统一样,采用了分层的架构。 Android结构 从架构图看,Android分为四个层,从高层到低层分别是应用程序层、应用程序框架层、系统运行库层和Linux内核层。开发人员也可以完全访问核心应用程序所使用的API框架。该应用程序的架构设计简化了组件的重用;任何一个应用程序都可以发布它的功能块并且任何其它的应用程序都可以使用其所发布的功能块(不过得遵循框架的安全性)。同样,该应用程序重用机制也使用户可以方便的替换程序组件。 隐藏在每个应用后面的是一系列的服务和系统, 其中包括; 丰富而又可扩展的视图(Views),可以用来构建应用程序,它包括列表(Lists),网格(Grids),文本框(Text boxes),按钮(Buttons),甚至可嵌入的web 浏览器。 内容提供器(Content Providers)使得应用程序可以访问另一个应用程序的数据(如联系人数据库),或者共享它们自己的数据 资源管理器(Resource Manager)提供非代码资源的访问,如本地字符串,图形,和布局文件(Layout files )。 通知管理器(Notification Manager) 使得应用程序可以在状态栏中显示自定义的提示信息。 活动管理器( Activity Manager) 用来管理应用程序生命周期并提供常用的导航回退功能。 Android开发四大组件分别是:活动(Activity):用于表现功能。服务(Service):后台运行服务,不提供界面呈现。广播接收器(BroadcastReceiver):用于接收广播。内容提供商(Content Provider):支持在多个应用中存储和读取数据,相当于数据库。 活动(当前界面视图): -- 任务一Android 开发环境的搭建 第一部分知识回顾与思考 1.Android 的四层架构分别包括哪几层?分别起到什么作用? 答:Linux 内核层(Linux Kernel ):基于Linux 内核,内核为上层系统提供了系统服务。 系统库层(Libraries ):系统库基于C/C++ 语言实现,通过接口向应用程序框架层提供编程接口。 应用框架层(Application Framework ):为开发者提供了一系列的Java API,包括图形用户界面组件 View 、SQLite 数据库相关的API 、Service 组件等。 应用程序层(Applications ):包含了Android 平台中各式各样的应用程序。 第二部分职业能力训练 一、单项选择题(下列答案中有一项是正确的,将正确答案填入括号内) 1.Android 四层架构中,应用框架层使用的是什么语法?(C)A .CB .C++C.Java D.Android 2.Android 四层架构中,系统库层使用的是什么语法?(B)A .VBB.C /C++C.Java D .Android 3.应用程序员编写的Android 应用程序,主要是调用(B)提供的接口进行实现。 A .应用程序层DCB.应用框架层.应用视图层.系统库层 二、填空题(请在括号内填空) 1.在Android 智能终端中,有很多应用如拍照软件、联系人管理软件,它们都属于Android 的(应用程 序)层。 2.为了让程序员更加方便的运行调试程序,Android 提供了(模拟器),可以方便的将程序运行其上, 而不要实际的移动终端。 程序运行,我们需要安装(Java 3.为了支持)。JDK 三、简答题 1.简述Android 开发环境安装的步骤。 答:下载并安装JDK ,配置JDK 的环境变量; 从Anroid 官网上下载Android 开发组件(包含Eclipse 和 实验二 android基本控件实验 【目的】 熟悉Android常用控件的基本操作,掌握它们的基本使用方法。了解控件之间的构成关系,熟悉适配器的使用原理。 【要求】 1、了解控件的继承关系; 2、掌握适配器的使用; 3、掌握信息提示的实现机制; 4、实现基本界面。 【原理】 1.控件类之间的关系 android.view.View类(视图类)呈现了最基本的UI构造块。View类是Android中的一个超类,几乎包含了所有的屏幕类型,主要负责绘制和事件处理。 Android中控件类的扩展结构如图所示。 View有众多的扩展者,它们大部分是在android.widget包中,这些继承者实际上就是Android 系统中的“控件”。View实际上就是各个控件的基类,创建交互式的图形用户界面的基础。View的直接继承者包括文本视图(TextView)、图像视图(ImageView)、进度条(ProgressBar)等。它们各自又有众多的继承者。每个控件除了继承父类功能之外,一般还具有自己的公有 方法、保护方法、XML属性等。 在Android中使用各种控件的一般情况是在布局文件中可以实现UI的外观,然后在Java文件中实现对各种控件的控制动作。控件类的名称也是它们在布局文件XML中使用的标签名称。 2.控件通用行为和属性 View是Android中所有控件类的基类,因此View中一些内容是所有控件类都具有的通用行为和属性。 提示:由于Java语言不支持多重继承,因此Android控件不可能以基本功能的“排列组合”的方式实现。在这种情况下,为了实现功能的复用,基类的功能往往做得较强,作为控件的祖先类,View所实现的功能也是最多的。 控件类经常在布局文件中使用,因此其可以使用XML属性(XMLAttributes),和Java代码经常具有对应关系。 View作为各种控件的基类,其XML属性所有控件通用,XML属性及其对应的方法如表1所示。 表1 View中的XML属性及其对应的方法 其中,android:id表示控件的标识,通常需要在布局文件中指定这个属性。View中与控件标识相关的几个方法如下所示: public int getId() // 获得控件的id(int类型) 创建控件并添加监听器的过程: 1.xml中定义控件() 2.Activity中实例化控件((Button)findViewById()) 3.创建监听器(OnClickListener) 4.绑定监听器(setOnClickListener) UI基础-内/外边距 UI基础-常用控件-单选按钮 UI基础-常用控件-输入控件 maxLines:最大行数。 maxLength:最大字符数。 hint:空白文字提示,当输入文字时自动消失。 password:密码文本框。 numeric:控制输入的数字类型,一共有三种分别为integer(正整数)、signed(带符号整数,有正负)和decimal(浮点数)。 digits:录入指定字符。 UI基础-常用控件-图片控件 CENTER:图片大小为原始大小,如果图片大小大于ImageView控件,则截取图片中间部分,若小于,则直接将图片居中显示。 CENTER_CROP:将图片等比例缩放,让图像的短边与ImageView的边长度相同,即不能留有空白,缩放后截取中间部分进行显示。 CENTER_INSIDE:将图片大小大于ImageView的图片进行等比例缩小,直到整幅图能够居中显示在ImageView中,小于ImageView的图片不变,直接居中显示。 FIT_CENTER:ImageView的默认状态,大图等比例缩小,使整幅图能够居中显示在ImageView中,小图等比例放大,同样要整体居中显示在ImageView中。 FIT_START:缩放方式同FIT_CENTER,只是将图片显示在左方或上方,而不是居中。FIT_END:缩放方式同FIT_CENTER,只是将图片显示在左方或上方,而不是居中。 FIT_XY:将图片非等比例缩放到大小与ImageView相同。 android布局layout中的一些属性 1、可以使某些资源文件或UI组件可重用 任务一Android 开发环境的搭建 第一部分知识回顾与思考 1. Android 的四层架构分别包括哪几层?分别起到什么作用? 答: Linux 内核层( Linux Kernel ):基于Linux 内核,内核为上层系统提供了系统服务。 系统库层( Libraries ):系统库基于C/C++ 语言实现,通过接口向应用程序框架层提供编程接口。 应用框架层( Application Framework ):为开发者提供了一系列的Java API,包括图形用户界面组件View 、 SQLite 数据库相关的API 、 Service 组件等。 应用程序层( Applications ):包含了Android 平台中各式各样的应用程序。 第二部分职业能力训练 一、单项选择题(下列答案中有一项是正确的,将正确答案填入括号内) 1. Android 四层架构中,应用框架层使用的是什么语法?(C) A . C B . C++C. Java D. Android 2. Android 四层架构中,系统库层使用的是什么语法?(B) A . V B B. C /C++C. Java D .Android 3.应用程序员编写的Android 应用程序,主要是调用(B)提供的接口进行实现。 A .应用程序层B.应用框架层C.应用视图层D.系统库层 二、填空题(请在括号内填空) 1.在 Android 智能终端中,有很多应用如拍照软件、联系人管理软件,它们都属于Android 的(应用程序)层。 2.为了让程序员更加方便的运行调试程序,Android 提供了(模拟器),可以方便的将程序运行其上, 而不要实际的移动终端。 3.为了支持Java 程序运行,我们需要安装(JDK )。 三、简答题 1.简述 Android 开发环境安装的步骤。 答:下载并安装JDK ,配置 JDK 的环境变量; 从 Anroid 官网上下载Android 开发组件(包含Eclipse 和 Android SDK 、 ADT ); 安装 Android 开发环境(包括配置Android SDK 的环境变量、打开 Eclipse 通过菜单设定Android SDK 路径)。 2.简述 Android 应用程序创建和运行的步骤。 第一类:属性值为true或false android:layout_centerHrizontal 水平居中 android:layout_centerVertical 垂直居中 android:layout_centerInparent 相对于父元素完全居中 android:layout_alignParentBottom 贴紧父元素的下边缘 android:layout_alignParentLeft 贴紧父元素的左边缘 android:layout_alignParentRight 贴紧父元素的右边缘 android:layout_alignParentTop 贴紧父元素的上边缘 android:layout_alignWithParentIfMissing 如果对应的兄弟元素找不到的话就以父元素做参照物 第二类:属性值必须为id的引用名“@id/id-name” android:layout_below 在某元素的下方 android:layout_above 在某元素的的上方 android:layout_toLeftOf 在某元素的左边 android:layout_toRightOf 在某元素的右边 android:layout_alignTop 本元素的上边缘和某元素的的上边缘对齐 android:layout_alignLeft 本元素的左边缘和某元素的的左边缘对齐 android:layout_alignBottom 本元素的下边缘和某元素的的下边缘对齐 android:layout_alignRight 本元素的右边缘和某元素的的右边缘对齐 第三类:属性值为具体的像素值,如30dip,40px android:layout_marginBottom 离某元素底边缘的距离 android:layout_marginLeft 离某元素左边缘的距离 android:layout_marginRight 离某元素右边缘的距离 android:layout_marginTop 离某元素上边缘的距离 EditText的android:hint 设置EditText为空时输入框内的提示信息。 初识Android上层应用5大基本组件收藏 5 Basic Components 1. Activity 2. Service 3. Broadcast Receiver 4. Content Provider 5. Intent Activity ——应用表示层(基类Activity) 应用程序中的每个屏幕都是通过继承和扩展基类Activity来实现的。 同一应用中的每个Activity是相互独立的。程序启动后显示的第一幅画面是应用程序的第一个Activity(默认窗口),而后可以根据需要从这个Activity启动另一个新的Activity。 Activity利用View来实现应用中的GUI(用户直接通过GUI和应用程序做交互)。Activity窗口内的可见内容通过基类View提供。使用Activity.setContentView()方法设置当前Activity中的View对象。 ●每个View对象控制着窗口内的一个矩形空间; ●View是一种层次化结构,Parent View中的布局属性会被子View继承; ●位于View层次关系最底层的子View对象所代表的矩形空间就是跟用户进 行交互的地方 Activity状态回调: ●onCreate ●onStart ●onRestart ●onResume ●onPause ●onStop ●onDestroy Service——没有可见的用户界面,但能够长时间运行于后台(基类Service)运行于应用程序进程的主线程中,因此Service不会阻塞其他组件和用户界面。 Service是不能自己启动的,必须通过Context对象(如一个Activity)调用startService 或bindService方法来启动(用这两种方法启动的Service的生命周期不同)。 1. 调用startService方法 a) 若Service没有启动,则首先会调用该Service的onCreate方法,然后 再调用onStart方法。 b) 若Service已经启动,则会直接调用onStart方法 c) 该方法启动的Service,可以通过Context对象调用stopService来关闭, 也可以通过Service自身调用stopSelf()或stopSelfResult()来关闭,关闭之前调 用onDestory方法。 2. 调用bindService方法,使当前Context对象通过一个ServiceConnection的 对象绑定到所指定的Service a) 若Service没有启动,则首先会调用该Service的onCreate方法初始化 启动,然后调用Service的onBind方法初始化绑定。 b) 如果绑定Service的Context对象被销毁时,被绑定的Service也会调用 onUnbind 和onDestroy方法停止运行 c) 注意:BroadcastReceiver是不能绑定服务的。 一、TextView控件常见的属性 二、EditText是可编辑的文本框,继承自TextView,因此属性基本相同。EditText中的文字可以编辑而TextView只显示文字,其中的文字不能编辑。EditText和TextView类似于C#中的Label和TextBox控件。 三、Button也继承自TextView,因此也具有TextView的宽和高设置,文字显示等一些基本属性。Button一般会与单击事件联系在一起。为Button注册单击事件有两种方法: 1.通过Button控件的setOnClickListener()方法为Button 注册OnClickListener。 2.通过使用android:OnClick属性在xml布局文件中为Button 指定单击事件发生时执行的函数。 当用户点击了Button时,Android系统调用activity的selfDestruct(View view)方法。指定的这个方法必须是public的,而且只有一个View类型的参数。例如: TextView、EditText、Button都可以用setText()方法设置控件中文本的值,也都可以用getText()获取的控件的文本值。需要注意的是EditText的getText()方法返回的是Editable对象。这个对象与string对象差不多,区别是:当我们修改了一个string对象的值后会返回一个新的string对象。因为string对象不能修改,所以返回新的对象。而Editable可以修改即返回的是它本身,因此在修改的时候不必创建新的对象,节约了内存。可以用getText().toString()方法将获得的Editable对象转换为string。 四、Menu Menu 控件不需要添加在xml布局文件中,需要在Activity中复写onCreateOptionsMenu(Menu menu)方法,当我们在模拟器或者在手机 实验二android基本控件实验报告 【目的】 熟悉Android常用控件的基本操作,掌握它们的基本使用方法。了解控件之间的构成关系,熟悉适配器的使用原理。 【要求】 1、了解控件的继承关系; 2、掌握适配器的使用; 3、掌握信息提示的实现机制; 4、实现基本界面。 【过程】 1.新建一个Android工程ControlTest; 2.编写布局文件,实现布局效果,如图: 源代码: 3.MainActivity代码: import android.app.Activity; import android.content.ClipData; import android.content.Context; import android.os.Bundle; import android.view.Gravity; import android.view.Menu; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class MainActivity extends Activity { private Button mButtonAdd; private TextView mTextClass, mTextGrade, mTextId, mTextName; private ListView mListView; private Spinner mSpinnerCourse; private String mCourseList, mAdapter; private ArrayList 一、开发概述 Android的控件体系分为三个类别: 1、基本控件 2、布局 3、容器 这三类控件主要分布在两个包中: 1、android.view 提供抽象接口 2、android.widget 提供系统内置的大部分控件 整个系统得控件都继承自android.view.View ,而布局及容器类继承自android.view.ViewGroup。 基本控件主要包括ImageView、ProgressBar、SurfaceView、TextView、EditText等。 布局 虽然布局跟容器均继承自android.view.ViewGroup,但并不像SWT那样提供了面板+布局 的结构,而是每种Layout就是一中特殊的面板,包括AbsoluteLayout、Fram eLayout、 LinearLayout、TableLayout、RelativeLayout等。 容器 这里的容器是指采用了特定的布局并且提供了行为的控件,包含ListView、GridView、Gallery、 Spinner等。 二、android常用控件 android常用控件之TextView、EditView、Button、Menu 示例:一个计算应用程序,输入2个数字,点击按钮进行计算两个数的积并且返回结果。 当点击模拟器右侧的Menu按钮,在输入界面中显示一个有关于和退出的菜单。 项目运行效果图: 开发步骤: 1、新建一个Android项目 2、在布局文件中依次添加EditText、TextView、EditText、Button(一定要按照界面 上控件显示的顺序在布局文件中添加) 3、再新建一个布局文件用来显示计算的结果;在这个布局文件中添加一个LinearLayout 和一个TextView(默认的布局文件中默认就有一个LinearLayout,所以不需要手动添加, 新建的布局文件默认为空,所以需要手动添加) 4、编写第一个Activity a) 让Activity继承android的Activity b) 重写Activity的onCreate()方法 c) 设置这个Activity的布局文件 d) 根据控件id获得控件对象 e) 设置控件的值,这个值引用的是string.xml中的值,所以还需要在string.xml文件中 设置(最好是使用string.xml中的值,以便实现国际化);这个在布局文件中也能设置; 5、新建一个Activity,ResultActivity a) 让Activity继承android的Activity b) 重写Activity的onCreate()方法 c) 设置这个Activity的布局文件 d) 根据控件id获得控件对象 6、在第一个Activity中编写Button的监听器 控件讲解 ? 在Windows 下搭建Android 开发环境 ? Android 项目的目录结构说明 ? 写一个简单的Hello World 程序 一、在Windows 下搭建Android 开发环境 1、安装JDK (Java Development Kit) https://www.wendangku.net/doc/986840929.html,/jdk6/ 2、安装Android SDK https://www.wendangku.net/doc/986840929.html,/sdk 3、安装Eclipse https://www.wendangku.net/doc/986840929.html,/ 4、打开Eclipse ,并安装其Android 插件(ADT) 打开菜单"Help" -> "Install New Software",在"Availabe Software" 中加入地址https://www.wendangku.net/doc/986840929.html,/android/eclipse/ ,然后安装ADT(Android Development Tools) 5、新建Android 项目 "New" -> Android Project,Project Name - 项目名称;Build Target - 编译项目的SDK 版本;Application name - 程序名称;Package name - 包名;Min SDK Version - 程序所支持的最低SDK 版本代号(2 对应 1.1,3 对应 1.5,4 对应 1.6) 6、运行Android 项目 打开菜单"Run" -> "Run Configurations" -> New launch configuration,设置启动项目名称,在Android 选项卡中选择启动项目,在Target 选项卡中设置模拟器 Android中常用控件 ListView ListVeiw 用来展示列表的View。 使用ListView时与之相关的两个要素:适配器和数据。 适配器用来把数据映射到ListView上的中介。 数据具体的将被映射的字符串,图片,或者基本组件。 根据列表的适配器类型,列表分为三种,ArrayAdapter,SimpleAdapter和SimpleCursorAdapter。其中以ArrayAdapter最为简单,只能展示一行字。SimpleAdapter有最好的扩充性,可以自定义出各种效果。SimpleCursorAdapter可以认为是SimpleAdapter对数据库的简单结合,可以方便的把数据库的内容以列表的形式展示出来。 ◆适配器之ArrayAdapter private ListView listView=null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(https://www.wendangku.net/doc/986840929.html,yout.main); ListView lv=(ListView)this.findViewById(R.id.listView1); lv.setAdapter(new ArrayAdapterandroid常用控件大全
Android开发日志—常用控件篇(android简介和容器控件)
Android应用开发基础习题
实验二 android基本控件实验
Android基础-控件的使用
android布局layout中的一些属性(DOC)
Android应用开发基础习题
android 控件常用属性
android五大组件详解
Android控件常见的属性
实验二 android基本控件实验
android开发常用控件及布局
Android控件大全以及各布局空间的使用方式
Android中常用控件List、View