[英]Update check-boxes status with visibility change
I am having check boxes to control the visibility of different views. 我有复选框来控制不同视图的可见性。 When check box status is changed similarly visibility is changed, which is working fine.
当复选框状态更改时,可见性也将更改,这可以正常工作。 In my app views visibility also changes on different user input.
在我的应用程序视图中,可见性也会随着不同的用户输入而改变。 I want to update checkbox status if visibility of view change by any way.
如果视图的可见性以任何方式改变,我想更新复选框状态。 Is there any way to do it.
有没有办法做到这一点。
You have to put 你必须把
checkbox.setChecked(true);
anywhere that you call 您打电话的任何地方
someView.setVisibility(View.INVISIBLE);
There is no way AFAIK that you can inherently "watch" the visibility state, you have to active set the checked state at the same time that you change the visibility state. AFAIK无法固有地“监视”可见性状态,必须在更改可见性状态的同时主动设置检查状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.