预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共60页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

Android开发教程之Android控件在Android中使用各种控件(View) ZoomControls-放大/缩小按钮控件 Include-整合控件 VideoView-视频播放控件 WebView-浏览器控件 RatingBar-评分控件 Tab-选项卡控件 Spinner-下拉框控件 Chronometer-计时器控件 ScrollView-滚动条控件zoomcontrols.xml viewplaincopytoclipboardprint? 01.<?xmlversion="1.0"encoding="utf-8"?> 02.<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" 03.android:orientation="vertical"android:layout_width="fill_parent" 04.android:layout_height="fill_parent"> 05.<!-- 06.放大/缩小按钮控件 07.--> 08.<ZoomControlsandroid:id="@+id/zoomControls"09.android:layout_width="wrap_content"android:layout_height="wrap_content"></ZoomControls> 10.</LinearLayout> <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"android:layout_width="fill_parent" android:layout_height="fill_parent"> <!-- 放大/缩小按钮控件 --> <ZoomControlsandroid:id="@+id/zoomControls" android:layout_width="wrap_content"android:layout_height="wrap_content"></ZoomControls> </LinearLayout>_ZoomControls.java viewplaincopytoclipboardprint? 01.packagecom.webabcd.view; 02.importandroid.app.Activity; 03.importandroid.os.Bundle; 04.importandroid.view.View; 05.importandroid.view.View.OnClickListener; 06.importandroid.widget.Toast; 07.importandroid.widget.ZoomControls;08.publicclass_ZoomControlsextendsActivity{ 09.@Override 10.protectedvoidonCreate(BundlesavedInstanceState){ 11.//TODOAuto-generatedmethodstub 12.super.onCreate(savedInstanceState); 13.this.setContentView(R.layout.zoomcontrols); 14.setTitle("ZoomControls"); 15.ZoomControlszoomControls=(ZoomControls)this.findViewById(R.id.zoomControls); 16.//setOnZoomInClickListener()-响应单击放大按钮的事件17.zoomControls.setOnZoomInClickListener(newOnClickListener(){ 18.publicvoidonClick(Viewv){ 19.Toast.makeText(_ZoomControls.this,"单击了放大按钮",Toast.LENGTH_SHORT).show(); 20.} 21.}); 22.//setOnZoomOutClickListener()-响应单击缩小按钮的事件 23.zoomControls.setOnZoomOutClickListener(newOnClickListener(){ 24.publicvoidonClick(Viewv){