0
我有一个带有两个分段控件的项目。他们都工作到iOS7.0。现在一个没有。我已阅读tintColor的问题,但我认为这是不同的。iOS 7中的UISegmentedControl
这两个控件都使用UIImages作为段。其中之一,图像都显示正确。另一方面,我得到所有蓝色图像。
我做错了什么或者这是一个错误?
这里的故障段的代码:
UISegmentedControl *colorControl = [[UISegmentedControl alloc] initWithItems:
[NSArray arrayWithObjects:
[UIImage imageNamed:@"White.png"],
[UIImage imageNamed:@"Red.png"],
[UIImage imageNamed:@"Yellow.png"],
[UIImage imageNamed:@"Green.png"],
[UIImage imageNamed:@"Blue.png"],
[UIImage imageNamed:@"Purple.png"],
[UIImage imageNamed:@"Black.png"], nil]];
CGRect frame = CGRectMake(rect.origin.x + kLeftMargin, rect.size.height - kPaletteHeight - kTopMargin, rect.size.width - (kLeftMargin + kRightMargin), kPaletteHeight);
colorControl.frame = frame;
// Add DoubleTap Color capability
gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showMoreColors:)];
[gesture setNumberOfTapsRequired:2];
[colorControl addGestureRecognizer:gesture];
// When the user chooses a color, the method changeColor: is called.
[colorControl addTarget:self action:@selector(changeColor:) forControlEvents:UIControlEventValueChanged];
// Make sure the color of the color complements the black background
//colorControl.tintColor = [UIColor clearColor];
// Add the control to the window
[self.view addSubview:colorControl];
虽然图像都是蓝色,段正常工作。