ui::CheckBox not enabling

I’m calling setEnabled on a CheckBox and nothing happens, only when I click do I see a change.

But how can I make the box checked manually?

The first place you should always look would be the public API for that class. It’s quite literally listed there:

ui::CheckBox::setSelected(...)

One thing though, I personally think that specific function name does not reflect the purpose. It should have been setChecked or something similar. In my mind, selection is more about the control, rather than the content of the control, like tabbing through controls to get to the one you want, you’re selecting a new control every time you tab through (at least that seems to be the convention in other UI implementations).

1 Like

I tried using CheckBox::set* in AndroidStudio couldn’t find setSelected(), I guess I didn’t look hard enough, thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.