iphone - Unable to highlight the segment control properly ios -
I am using a volume control and when not selecting it and the user tries to move to the next screen, Then he should highlight it. / P>
My code logic:
+ (zero) Valid validation controller: (UISegmentedControl *) Segment Control {// Icon Invalid Field Segment. Control. Player CoreRadia = 4.0F; SegmentControl.layer.masksToBounds = Yes; Section control. Layer.Bidder Corner [[UIColor colorWithRed: 175 / 255.0 Green: 14 / 255.0 Blue: 37 / 255.0 alpha: 1] .CG color; SegmentControl.layer.borderWidth = 1.0f; } But the problem is that, red highlight is very less than the segment control, not sure why this is happening. Tried to reduce the corner radius, but no luck.
Here's the image:
Problems can be there.
I came to know that, if you divided the width of the controller with your section, the number of your sections , If it gives an integer, then all your codes work fine, on the other hand, if returns a value with decimal places, then the way you have it now will end, for example:
If the controller in my block has 4 sections, and its total width is 240. 240/4 = 60, this is an integer value. After adding the boundary, it looks like this:
< / P>
But when I change width to 250, 250/4 = 62.5, where there are decimal places, it becomes like this:
So I think the easiest solution in your case just change the width of your segmented control to X Which will give X = (Segment width) * 3, and the width of the segment Must be an integer value.
Hope that helps and to be honest, I never knew that before this question and I am not able to understand why it seems that the SDK controls segments like this Does.
Comments
Post a Comment