怎么办preference属性的android的反面:依赖关系? [英] How to do opposite of of preference attribute android:dependency?
问题描述
是否有确实的 Android的完全相反的XML属性:依赖
?
我想依赖preference它被选中时,启用时,另一种是不检查和残疾人。
What I would like the dependent preference to be enabled when the other is NOT checked and disabled when it IS checked.
编辑:也许这个问题是不是与安卓依赖
也许有一个XML属性,我可以添加使默认为preference禁用,那么 Android的:依赖
将切换它相反的方式像我想
edit: maybe the issue isn't with android:dependency
maybe there is an xml attribute that I can add to make the default for that preference disabled and then android:dependency
will toggle it the opposite way like i want.
再修改:
我尝试设置安卓启用=假
在preference和禁止它像我想要的,但即使它是依赖于其他的preference它没能像我所希望的。
edit again:
I tried setting android:enabled="false"
in the preference and it disables it like i want but even with it being dependent on the other preference it didn't enable it like i had hoped
推荐答案
居然发现它在我自己想通我只是张贴在这里,以帮助任何人可能有同样的问题:
Actually found it on my own and figured I'd just post it here to help anyone that might have this same issue:
android:disableDependentsState="true"
提出,在控制preference。
Put that in the controlling preference.
这篇关于怎么办preference属性的android的反面:依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!