
我知道这听起来很怪异,所以这是图片.
它保持正确的价值.选择(部分)正确的单选按钮. OnCheckedchangelistener中的所有逻辑都正确执行.我完全惊呆了.为什么没有完全检查单选按钮?
我唯一能想到的是我正在使用Rx2Firebase
periodRetrIEver = FirebaseHelper.getInstance(getContext()).getPeriod() .defaultIfEmpty(0) .distinctUntilChanged() .subscribe(new Consumer<Integer>() { @OverrIDe public voID accept(@NonNull Integer headerType) throws Exception { ge@R_404_6205@ioVIEwChecked(headerType).setChecked(true); } });EDIT1
马科斯建议我看不到白蜱.不是这种情况.
EDIT2
布局:
<RadioGroup androID:ID="@+ID/rgPeriod" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:orIEntation="horizontal"> <androID.support.v7.Widget.AppCompa@R_404_6205@iobutton androID:ID="@+ID/rbMonth" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:checked="false" androID:text="@string/month" /> <androID.support.v7.Widget.AppCompa@R_404_6205@iobutton androID:ID="@+ID/rbWeek" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:checked="false" androID:text="@string/week" /> <androID.support.v7.Widget.AppCompa@R_404_6205@iobutton androID:ID="@+ID/rb4Weeks" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:checked="false" androID:text="@string/four_weeks" /></RadioGroup>解决方法:
看起来像动画BUG.在VIEwPager内的Fragment上使用Compoundbutton时,未正确设置drawable状态.
复选框也会发生这种情况,如下所示:Android Nougat: Why do checkboxes on Fragment have incomplete state when selected programmatically (but look fine on Lollipop).
在调用RadioGroup.check(ID)或CheckBox.setChecked(true)之后调用jumpDrawablesToCurrentState()似乎解决了问题(thx @Dalmas)
总结以上是内存溢出为你收集整理的android – 单选按钮仅部分检查全部内容,希望文章能够帮你解决android – 单选按钮仅部分检查所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)