Hue color for segmented control without dash

I have a compilation problem with UiSegmentedControl whose style is glazed. Black color. I get an error message:

"Tint color on non-bar style segmented control" 

Can this be solved, and is it a problem to send the application?

+4
source share
3 answers

I think the error is in Xcode / Interface Builder.
IOS HIG says nothing about the different styles, and the documentation explicitly permits hue colors for browsable UISegmentedControls:

UISegmentedControlStyleBezeled
Segmented controls in this style can have a hue of color.

I would simply ignore the warning.

+7
source

In the interface builder, select a segment control.

In the Attribute Inspector, set the Tint parameter to Default .

+1
source

For some reason, XIB disables this warning, but iOS does support tintColor with a stylized style. You can avoid the warning by specifying it programmatically. However, there is a trick. If the style is set to bezeled, the tintColor setting will be ignored. You need to do it like this:

 [segControl setSegmentedControlStyle:UISegmentedControlStyleBar]; segControl.tintColor = [UIColor colorWithWhite:0.48 alpha:1.0]; [segControl setSegmentedControlStyle:UISegmentedControlStyleBezeled]; 

In this case, I load the XIB that it is set to trim (so that I can see how it fits) ... but I returned it to the panel and changed the hue before setting it up. Weird

0
source

All Articles