WEB开发网
开发学院手机开发Android 开发 Android控件之ZoomControls缩放控件 阅读

Android控件之ZoomControls缩放控件

 2010-11-05 00:57:34 来源:WEB开发网   
核心提示:import android.widget.TextView;import android.widget.ZoomControls;public class ZoomControlsDemo extends Activity {private ZoomControls zoomControls;static long

import android.widget.TextView;

import android.widget.ZoomControls;

public class ZoomControlsDemo extends Activity {

private ZoomControls zoomControls;

static long size = 12;

private TextView text;

/*

* (non-Javadoc)

*

* @see android.app.Activity#onCreate(android.os.Bundle)

*/

@Override

protected void onCreate(Bundle savedInstanceState) {

// TODO Auto-generated method stub

super.onCreate(savedInstanceState);

setContentView(R.layout.zoomcontrols);

setTitle("ZoomControls");

zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols);

text = (TextView) findViewById(R.id.text);

zoomControls.setOnZoomInClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

size = size + 2;

text.setTextSize(size);

}

});

zoomControls.setOnZoomOutClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

size = size - 2;

text.setTextSize(size);

}

});

}

}

上一页  1 2 

Tags:Android 控件 ZoomControls

编辑录入:coldstar [复制链接] [打 印]
赞助商链接