UISegmentcontrol appearances causing issues

后端 未结 2 1731
予麋鹿
予麋鹿 2021-01-23 15:58

i need help on my UISegment appearances, i set this in my app delegate everything works fine.

till i add in this code to change my selected segment color, it caused an i

2条回答
  •  走了就别回头了
    2021-01-23 16:30

    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?

提交回复
热议问题