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 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);
}
});
}
}
Tags:Android 控件 ZoomControls
编辑录入:coldstar [复制链接] [打 印]更多精彩
赞助商链接