سؤال

I have a UISegment controller,In this controller I want to change the selected segment controller tab color to orange.Other tab will be normal gray color. Please help me how to achieve this.

هل كانت مفيدة؟

المحلول

Simple way to get this using UISegmentedControl appearance

[[UISegmentedControl appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                         [UIColor orangeColor],UITextAttributeTextColor, nil]
                                               forState:UIControlStateSelected];
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top