button_up.setBackgroundResource(R.drawable.upg);//向上的键为白色 button_up.setClickable...button_down.setBackgroundResource(R.drawable.downb); //向下的键为灰色 button_down.setClickable...button_down.setBackgroundResource(R.drawable.downg); //向下的键为白色 button_down.setClickable...button_up.setBackgroundResource(R.drawable.upb);//向上的键为灰色 button_up.setClickable...(true); //可点击 button_up.setClickable(true);//可点击 button_up.setBackgroundResource
(true); btStopWhackAMole.setClickable(false); } public void whackAMole(View view){ view.setBackgroundResource...(R.drawable.hit); view.setClickable(false); score++; time=time_s-score*10; tvWhackAMoleScore.setText(...(false); btStopWhackAMole.setClickable(true); num=0; score=0; flag=0; //开始 tvWhackAMoleScore.setText(..."分数:0"); new MyAsyncTask().execute(); break; case R.id.btStopWhackAMole: btStartWhackAMole.setClickable...(true); btStopWhackAMole.setClickable(false); score=0; flag=1; //停止 new MyAsyncTask().execute(); break
(false); button01.setClickable(false); button02.setClickable(false); button10.setClickable(false); button11....setClickable(false); button12.setClickable(false); button20.setClickable(false); button21.setClickable...(true); button01.setClickable(true); button02.setClickable(true); button10.setClickable(true); button11....setClickable(true); button12.setClickable(true); button20.setClickable(true); button21.setClickable(...true); button22.setClickable(true); random(); } } 最后运行项目,就能够进行拼图游戏了!
long id) { imageSwitcher.setVisibility(View.VISIBLE); imageSwitcher.setClickable...long id) { imageSwitcher.setVisibility(View.VISIBLE); imageSwitcher.setClickable...onClick(View v) { imageSwitcher.setVisibility(View.GONE); imageSwitcher.setClickable...(false); } }); imageSwitcher.setClickable(false); } } 几点值得注意的: 由于SimpleAdapter
this.seconds, 1000) { @Override public void onTick(long l) { textView.setClickable... public void onFinish() { textView.setText("重新获取"); textView.setClickable
parent, View view, int position, long id) { imageSwitcher.setVisibility(View.VISIBLE); imageSwitcher.setClickable...parent, View view, int position, long id) { imageSwitcher.setVisibility(View.VISIBLE); imageSwitcher.setClickable...View.OnClickListener() { @Override public void onClick(View v) { imageSwitcher.setVisibility(View.GONE); imageSwitcher.setClickable...(false); } }); imageSwitcher.setClickable(false); } } 几点值得注意的: 由于SimpleAdapter 对象 是根据Map 建立的 ,所以他们的Key
boolean isClick) { button.setText(content); button.setBackgroundColor(Color.parseColor(color)); button.setClickable...msg.arg1 == 0) { btn2.setText(“重新获取”); btn2.setBackgroundColor(Color.parseColor(“#f95353”)); btn2.setClickable...{ btn2.setText(“(” + msg.arg1 + “)秒”); btn2.setBackgroundColor(Color.parseColor(“#c1c1c1”)); btn2.setClickable
} @Override public void onTick(long millisUntilFinished) { //倒计时状态 getVerificationCodeBtn.setClickable...getVerificationCodeBtn.setTextColor(getResources().getColor(R.color.white)); getVerificationCodeBtn.setClickable
content.isEmpty()) { textView.setClickable(true); textView.setEnabled(true); textView.setTextColor...(Color.BLUE); } else { textView.setClickable(false); textView.setEnabled(false); textView.setTextColor
@Override public void onTick(long l) { //防止计时过程中重复点击 timeButton.setClickable...//重新给Button设置文字 timeButton.setText("重新获取"); //设置可点击 timeButton.setClickable
; mTextView = textView; } @Override public void onTick(long millisUntilFinished) { mTextView.setClickable...mTextView.setText("重新获取" + millisUntilFinished / 1000 + "秒"); } @Override public void onFinish() { mTextView.setClickable
View.OnClickListener() { @Override public void onClick(View view) { // tvSave.setClickable...e.printStackTrace(); } } else { tvSave.setClickable...&& mLDialog.isShowing()) { // mLDialog.dismiss(); // } tvSave.setClickable
this.mTextView = textView; } @Override public void onTick(long millisUntilFinished) { mTextView.setClickable...spannableString); } @Override public void onFinish() { mTextView.setText("重新获取验证码"); mTextView.setClickable
) { tvCode.setText("重新获取"); tvCodeWr.setTextColor(Color.parseColor("#E94715")); tvCode.setClickable...= null) { tvCode.setClickable(false); tvCode.setEnabled(false); tvCode.setText...tvCodeWr.get().setTextColor(Color.parseColor(color)); tvCodeWr.get().setClickable...= null) { tvCodeWr.get().setClickable(false); tvCodeWr.get().setEnabled(false);
} //计时过程 @Override public void onTick(long l) { //防止计时过程中重复点击 timeButton.setClickable...onFinish() { //重新给Button设置文字 timeButton.setText("重新获取"); //设置可点击 timeButton.setClickable
= null)) { setFocusable(FOCUSABLE); setClickable(true); setLongClickable...(true); } else { setFocusable(FOCUSABLE_AUTO); setClickable(false);
setEnabled()与setClickable()区别 setEnabled设置为true,相当于激活事件,对触摸产生反应,而设置成false。...无论是否设置setClickable为false 还是true都不可点击,无法响应事件....Button click = findViewById(R.id.click); //click.setClickable(false); //click.setEnabled(true); //设置false...onClickListener事件之后设置clickable为false才可以不能点击,不响应事件,否则之前设置还是可以点击,但是设置false之后,但是还会产生一闪一闪变化 click.setClickable...isClickable()) { setClickable(true); } getListenerInfo().mOnClickListener = l; } TouchDelegate
mTimeCount.start(); } /** * 取消计时 */ public void cancle() { mTimeCount.cancel(); setClickable...millisUntilFinished 当前时间 */ @Override public void onTick(long millisUntilFinished) { setClickable...setBackgroundResource(mClickedBackground); } @Override public void onFinish() { setClickable
从而实现侧滑时删除按钮滑出的效果功能 */ public void onDragTouchEvent(MotionEvent event) { if (isDrag) {//手指在横向滑动时设置条目不可点击 setClickable...(false); } else { setClickable(true); } int x = (int) event.getX(); int y = (int) event.getY(); int scrollX...deltaX;//当这个值变小时,view视图向左滑动 if (newScrollX < 0) {//保持大于等于0,等于0时view左上角x值和屏幕左上角x值重合 newScrollX = 0; setClickable...= 0) { autoScrollToX(0, 100); new Handler().postDelayed(new Runnable() { public void run() { setClickable
= null) { mTextView.setClickable(false); //设置不可点击 mTextView.setText(millisUntilFinished...= null) { mTextView.setText("获取验证码"); mTextView.setClickable(true);//重新获得点击
领取专属 10元无门槛券
手把手带您无忧上云