UISegmentcontrol appearances causing issues

瘦欲@ 提交于 2019-12-02 05:16:22

It looks like the code above is only setting appearance for UIControlStateNormal, you also need to set the appearance for UIControlStateSelected.

nice way to tint the single segments, i was looking for something like that. But now i wonder if it's a "legal" way...

with:

[[infoSegment.subviews objectAtIndex:i] setTintColor:[UIColor colorWithRed:196.0/255.0 green:223.0/255.0 blue:155.0/255.0 alpha:1]];

it seems you are using the "private" property "tintColor" of the single elements in the UISegmentedControl, not officially declared by apple (it's declared just the property "tintColor" of the whole UISegmentedControl, then apple use it to colorize in 2 different way the elements, the selected one and the other).

so, your method could really work, and i'm considering to use it... but apple could reject your app if it's really considered a private setter method... have you ever used it in an app approved for iStore?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!