我知道這聽起來很奇怪,所以這裏是圖片。單選按鈕只是部分檢查
它持有正確的值。正確的單選按鈕(部分)被選中。 OnCheckedChangeListener
中的所有邏輯都正確執行。我完全驚呆了。爲什麼單選按鈕沒有完全檢查?
只有我能想到的事情是,我使用Rx2Firebase
periodRetriever = FirebaseHelper.getInstance(getContext()).getPeriod()
.defaultIfEmpty(0)
.distinctUntilChanged()
.subscribe(new Consumer<Integer>() {
@Override
public void accept(@NonNull Integer headerType) throws Exception {
getRadioViewChecked(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.AppCompatRadioButton
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.AppCompatRadioButton
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.AppCompatRadioButton
android:id="@+id/rb4Weeks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="@string/four_weeks" />
</RadioGroup>
你指的是一個事實,即圓不具有後點在中心?如果是這樣,你的主題是什麼,你做了什麼來定製'RadioButton'的外觀? – CommonsWare
@CommonsWare是的,這就是我指的!除了設置'colorPrimary'和'colorAccent'之外,我沒有做過任何樣式的設計。當它全部同步時,我沒有這個問題。 –
也許你延伸的主題使用白色選擇點 如果你使用黑色主題切換到光照或否則 –