Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有复选框来控制不同视图的可见性。当复选框状态改变时,可见性也会改变,这工作正常。在我的应用程序视图中,可见性也会随着不同的用户输入而变化。如果视图的可见性以任何方式发生变化,我想更新复选框状态。有没有办法做到这一点。
你必须把
checkbox.setChecked(true);
你打电话的任何地方
someView.setVisibility(View.INVISIBLE);
AFAIK 无法固有地“观察”可见性状态,您必须在更改可见性状态的同时主动设置选中状态。