gpt4 book ai didi

Android禁用按钮

转载 作者:太空宇宙 更新时间:2023-11-03 13:05:02 29 4
gpt4 key购买 nike

我不明白为什么这不会将按钮设置为禁用?

btnSaturdayStartTime = (Button)findViewById(R.id.btnSaturdayStartTime);
btnSaturdayStartTime.setEnabled(false);

当我点击按钮时它仍然触发监听器。

最佳答案

尝试使用 btnSaturdayStartTime.setClickable(false)。

参见 setClickable来自文档。

关于Android禁用按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6130365/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com