读书人

兑现按钮按下的效果

发布时间: 2012-07-03 13:37:43 作者: rapoo

实现按钮按下的效果

public boolean onTouch(View v, MotionEvent event)
?{
?Intent intent = new Intent();
?
??switch(v.getId())
??{
??
??case R.id.user_guide:? //使用说明
???if(event.getAction()==MotionEvent.ACTION_DOWN)
???{
????btnUserGuide.setBackgroundResource(R.drawable.main_button_touched);
???}
???else if(event.getAction() == MotionEvent.ACTION_UP)
????? {
????????? btnUserGuide.setBackgroundResource(R.drawable.main_button);
????????? intent.setClass(Main.this,UserGuider.class);
????????? startActivity(intent);
????? }
?????
???break;

?

?

....

读书人网 >移动开发

热点推荐