0
如何設置用於iPhone ios 4.3的UISegmentedControl的字體顏色?如何設置UISegmentedControl for iPhone的字體顏色ios 4.3
爲iOS 5.0,我使用
UISegmentedControl *button = [[[UISegmentedControl alloc]
initWithItems:[NSArray >arrayWithObjects:itemTitle, nil]] autorelease];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:fontColor forKey:UITextAttributeTextColor];
[button setTitleTextAttributes:attributes forState:UIControlStateNormal];
button.momentary = YES;
button.segmentedControlStyle = UISegmentedControlStyleBar;
button.tintColor = tintColor;