文件名称:android开发示例
文件大小:1.18MB
文件格式:ZIP
更新时间:2015-04-19 17:38:01
android开发示例
android开发示例 importandroid.app.Activity; importandroid.content.Context; importandroid.graphics.drawable.Drawable; importandroid.graphics.drawable.StateListDrawable; importandroid.os.Bundle; importandroid.view.View; importandroid.widget.Button; public class TestButton extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Integer[] mButtonState = { R.drawable.defaultbutton, R.drawable.focusedpressed, R.drawable.pressed }; Button mButton = (Button) findViewById(R.id.button); MyButtonmyButton = new MyButton(this); mButton.setBackgroundDrawable(myButton.setbg(mButtonState)); }
【文件预览】:
android开发示例.pdf