-
Notifications
You must be signed in to change notification settings - Fork 125
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
Strange thin line on the right side of selected indicator #27
Comments
Can you post the code you use to set up the control? |
I have the same. It seems to happen when the labels are too long. With the same settings, if I enlarge the Here are my settings: /*
SegmentedControl
*/
// titles
[self.segmentedControl insertSegmentWithTitle:@"infos"
atIndex:0];
[self.segmentedControl insertSegmentWithTitle:@"questions"
atIndex:1];
[self.segmentedControl insertSegmentWithTitle:@"indications"
atIndex:2];
[self.segmentedControl insertSegmentWithTitle:@"solution"
atIndex:3];
// actions
[self.segmentedControl addTarget:self
action:@selector(segmentedControlHasBeenTouched:)
forControlEvents:UIControlEventValueChanged];
// setting up
UIColor * color = [[CBDGlobalInfo colorClusterForExercise:self.exercise] referenceColor] ;
UIFont * font = [CBDGlobalInfo fontThinWithSize:25] ;
self.segmentedControl.titleFont = font ;
self.segmentedControl.titleTextColor = color;
self.segmentedControl.selectedTitleFont = font ;
self.segmentedControl.selectedTitleTextColor = [UIColor whiteColor];
self.segmentedControl.borderWidth = 0.0f ; //1.0f;
self.segmentedControl.borderColor = [UIColor clearColor] ; //color ;
self.segmentedControl.backgroundColor = [UIColor clearColor] ;
self.segmentedControl.cornerRadius = [CBDGlobalInfo cornerRadius] ;
self.segmentedControl.drawsGradientBackground = NO;
self.segmentedControl.drawsSegmentIndicatorGradientBackground = NO;
self.segmentedControl.segmentIndicatorBackgroundColor = color ;
self.segmentedControl.segmentIndicatorBorderColor = [UIColor clearColor] ;
self.segmentedControl.segmentIndicatorBorderWidth = 0.0f ;
self.segmentedControl.segmentIndicatorInset = 2.0f ; //5.0f ; |
@nealyoung In - (void)drawRect:(CGRect)rect {
if (self.drawsGradientBackground) {
CAGradientLayer *gradientLayer = (CAGradientLayer *)self.layer;
gradientLayer.colors = @[(__bridge id)[self.gradientTopColor CGColor],
(__bridge id)[self.gradientBottomColor CGColor]];
} else {
self.layer.backgroundColor = [self.backgroundColor CGColor];
}
} If you comment this method, there is no more this line. |
I have new feed back on this. I have the "strange" line with these settings [self.segmentedControl setUpForSegmentColor:color
titleColor:[UIColor blackColor]
selectedTitleColor:[UIColor whiteColor]
font:font
cornerRadius:[CBDGlobalInfo cornerRadius]] ; but it disappears when only changing [self.segmentedControl setUpForSegmentColor:color
titleColor:color
selectedTitleColor:[UIColor whiteColor]
font:font
cornerRadius:[CBDGlobalInfo cornerRadius]] ; |
I have created a toy project that shows the problem. |
I use the control in titleView, if i push and pop back it goes away but it appears anytime first time.
The text was updated successfully, but these errors were encountered: