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

Is it possible to add LUNSegmentedControl programmatically? #6

Closed
hemangshah opened this issue Sep 14, 2016 · 1 comment
Closed

Is it possible to add LUNSegmentedControl programmatically? #6

hemangshah opened this issue Sep 14, 2016 · 1 comment

Comments

@hemangshah
Copy link

I am working on a app which has no storyboard or XIB to design a view so I am adding LUNSegmentedControl programmatically. But it's frame is always showing at this position,
(X = 0, Y = 0)

Can you confirm that your control is supporting programmatic interface.

seland added a commit that referenced this issue Sep 15, 2016
@hemangshah
Copy link
Author

hemangshah commented Nov 4, 2016

LUNSegmentedControl *segmentControl = [[LUNSegmentedControl alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 160.0f, 30.0f)];
segmentControl.dataSource = self;
segmentControl.delegate = self;
segmentControl.transitionStyle = LUNSegmentedControlTransitionStyleFade;
segmentControl.shapeStyle = LUNSegmentedControlShapeStyleLiquid;
segmentControl.translatesAutoresizingMaskIntoConstraints = YES;
segmentControl.shadowsEnabled = NO;
segmentControl.selectorViewColor = RGB(234, 88, 35, 1);
segmentControl.backgroundColor = RGB(37, 37, 37, 1);
segmentControl.cornerRadius = 10.0f;
segmentControl.applyCornerRadiusToSelectorView = YES;
[cell.contentView addSubview:segmentControl];

RGB is a function which generates a UIColor based on the values.

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