Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding segments programaticly with weights doesn't work #11

Closed
eclair4151 opened this issue Jun 11, 2014 · 1 comment
Closed

adding segments programaticly with weights doesn't work #11

eclair4151 opened this issue Jun 11, 2014 · 1 comment

Comments

@eclair4151
Copy link

I have a template layout with a radiobutton with width 0 and weight 1, and i try to add 4 buttons programaticly to an already created empty Segment group, but it ignores the weight, and just makes them the size they would be if it were set to wrap content

@eclair4151
Copy link
Author

turns our to be an android issue not an issue with this library. to do it you need to set the weight programaticly:

RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.segment_radio_button_template, null);
radioButton.setText(button);
radioButton.setLayoutParams(new RadioGroup.LayoutParams(RadioGroup.LayoutParams.WRAP_CONTENT, RadioGroup.LayoutParams.WRAP_CONTENT, 1f));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant