ios - UISegmentedControl tintColor -


i'm having problems getting uisegmentedcontrol show desired tint color.

// appdelegate - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {     // need red tint color in other views of app     [[uiview appearance] settintcolor:[uicolor redcolor]];     return yes; }  // viewcontroller - (void)viewdidload {     [super viewdidload];     nsarray *items = @[@"item 1", @"item 2"];     uisegmentedcontrol *control = [[uisegmentedcontrol alloc] initwithitems:items];     // have control have green tint color     control.tintcolor = [uicolor greencolor];     [self.view addsubview:control]; } 

how make uisegmentedcontrol use green tint color?

try ?

for (uiview *subview in mysegmentedcontrol.subviews) {    [subview settintcolor: [uicolor greencolor]]; } 

but appears known issue in ios 7, don't know if has been fixed in ios 8.

"you cannot customize segmented control’s style on ios 7. segmented controls have 1 style"

uikit user interface catalog


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -