Open Westy-Dev opened 8 years ago
I would also be curious how to do this.
+1
Same for me, need dynamic control.
Solved it today! You've got to use SegmentedGroup.removeView() after you remove each one of the radiobuttons you want out you call SegmentedGroup.updateBackground() this will solve this issue #
What ended up working for me was reseting the layout params for the other radio buttons after removing the last one.
SegmentedGroup.removeView(view3)
SegmentedGroup.updateBackground()
val layoutParams = RadioGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT, 1f)
view1.setLayoutParams(layoutParams)
view2.setLayoutParams(layoutParams)
First of all - great library.
I have written code to remove (either by removeView or setVisibility(View.GONE) ), an element from the segmented group, but this causes a visual issue due to a segment being cut and the round edges not being re-added (far right element is removed in my case).
How can I go about adding the rounded closed edges back to this element?
Many thanks.