btnCall.setClickable(false);
我使用此代码进行设置,但我想得到它。
谁知道答案请建议我?
答案 0 :(得分:1)
以下是ImageButton
的可点击状态:
ImageButton myButton = (ImageButton) findViewById(R.id.button1);
myButton.setClickable(false);
// if clickable is false
if (myButton.isClickable() == false) {
Log.i("MyButton", "Clickable is false");
// do your things here
...
}
// if clickable is true
if (myButton.isClickable() == true) {
Log.i("MyButton", "Clickable is true");
// do your things here
...
}
答案 1 :(得分:0)
这是针对Android的,因为你在标题中已经提到过了!
如果您想知道ImageButton
是否可点击,请使用..
boolean status = btnCall.isClickable(); // will return true if its clickable, false otherwise