You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Same for me. If I use RadioGroupPlus.addView(...) to add a LinearLayout which contains a RadioButton, only the 1st LinearLayout (together with its radio button) is displayed. So this piece of solution is incomplete.
It turns out to be an Android SDK bug in LinearLayout which the RadioGroupPlus class extends. LinearLayout has an attribute called orientation that can be either VERTICAL or HORIZONTAL. By right, it can be set either in XML or source code:
In XML:
public RadioGroupPlus(Context context) {
super(context);
setOrientation(VERTICAL);
init();
}
However, it turns out that this orientation can only be set effectively in XML, if you don't set it in XML, if will default to HORIZONTAL. Later, even if you set it to VERTICAL in the source code, it will still be horizontal and thus, only the 1st item is shown.
I need to add custom views to the radio group it seems working when added on layout. But its not working when added dynamically.
The text was updated successfully, but these errors were encountered: