Android Nougat: Why do checkboxes on Fragment have incomplete state when selected programmatically (but look fine on Lollipop)

前端 未结 1 1800
臣服心动
臣服心动 2020-12-17 17:14

Here is what my settings tab (Fragment) looks like before any selections are made:

From the main Fragment the user can make a selection from the Spinner --

相关标签:
1条回答
  • 2020-12-17 18:12

    just Call this jumpDrawablesToCurrentState() after calling radioButton.setChecked(true) or checkBox.setChecked(true);

    Code which worked for me in my Case


    CheckBox checkBox   = (CheckBox) clView;   
    checkBox.setChecked(true);
    checkBox.jumpDrawablesToCurrentState();
    
    RadioButton radioButton = (RadioButton)  clView; 
    radioButton.setChecked(true);
    radioButton.jumpDrawablesToCurrentState();
    
    0 讨论(0)
提交回复
热议问题