UISegmentedControl总是显得暗淡

时间:2014-06-04 19:57:38

标签: ios user-interface ios7 uisegmentedcontrol

无论我尝试什么设置,我都无法使用我设置的tintColor来渲染UISegmentedControl。我拍了几张截图,似乎我设置的颜色,渲染的结果是20%更暗(即UIColor whiteColor结束R:204,G:204,B:204)

我已经尝试了以下设置的每个组合,似乎没有任何改变它总是看起来更暗的事实。但是,在设置值,出现等之前/之后的所有阶段检查tintAdjustmentMode都是UITintAdjustmentModeNormal。我可以使文本的背景颜色以全亮度渲染,但帧和选定的索引填充始终为80%亮度。奇怪的是,这并不是在7.1模拟器中发生的,但它确实发生在我的带有7.1.1的iPhone 5上。

有没有人有类似的问题?我已经阅读了很多关于控件而不是调光的其他主题,或者想要为控件的不同部分设置不同颜色的人,但是找不到任何关于控件的颜色的tintColors。 t以全亮度显示。

我已尝试过各种各样的设置:

UIColor *tintColorToSet = [UIColor colorWithRed:0/255.0f green:241/255.0f blue:1.0f alpha:1.0f];
NSMutableDictionary *textAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
       tintColorToSet, NSForegroundColorAttributeName,
       [UIColor clearColor], NSBackgroundColorAttributeName,
       [UIFont fontWithName:@"NesController" size:18.0f], NSFontAttributeName, nil];
[_lengthBar setTitleTextAttributes:textAttributes forState:UIControlStateNormal];
[textAttributes setValue:[UIColor blackColor] forKey:NSForegroundColorAttributeName];
[_lengthBar setTitleTextAttributes:textAttributes forState:UIControlStateSelected];
_lengthBar.tintColor = tintColorToSet;
_lengthBar.alpha = 1.0f;
_lengthBar.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;

感谢您的帮助。

0 个答案:

没有答案