- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- Button button1 = (Button)findViewById(R.id.button1);
- Drawable alpha1 = button1.getBackground();
- alpha1.setAlpha(20);
- Button button2 = (Button)findViewById(R.id.button2);
- Drawable alpha2 = button2.getBackground();
- alpha2.setAlpha(100);
- Button button3 = (Button)findViewById(R.id.button3);
- Drawable alpha3 = button3.getBackground();
- alpha3.setAlpha(200);
- Button button4 = (Button)findViewById(R.id.button4);
- }
全站熱搜
留言列表