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];
雖然圖像都是藍色,段正常工作。