Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UISegmentedControl始终显示为暗淡_Ios_User Interface_Ios7_Uisegmentedcontrol - Fatal编程技术网

Ios UISegmentedControl始终显示为暗淡

Ios UISegmentedControl始终显示为暗淡,ios,user-interface,ios7,uisegmentedcontrol,Ios,User Interface,Ios7,Uisegmentedcontrol,无论我尝试什么设置,我都无法让UISegmentedControl使用我设置的tintColor进行渲染。我拍了一些屏幕截图,看起来无论我设置了什么颜色,渲染结果都会变暗20%,也就是说UIColor whiteColor最终会变成R:204,G:204,B:204 我尝试了下面的每一种设置组合,但似乎没有什么改变它总是看起来更暗的事实。但是,在设置值、显示等之前/之后的所有阶段检查tintAdjustmentMode显示为UIIntadjustmentModeNormal。我可以使文本的背景色

无论我尝试什么设置,我都无法让UISegmentedControl使用我设置的tintColor进行渲染。我拍了一些屏幕截图,看起来无论我设置了什么颜色,渲染结果都会变暗20%,也就是说UIColor whiteColor最终会变成R:204,G:204,B:204


我尝试了下面的每一种设置组合,但似乎没有什么改变它总是看起来更暗的事实。但是,在设置值、显示等之前/之后的所有阶段检查tintAdjustmentMode显示为UIIntadjustmentModeNormal。我可以使文本的背景色以全亮度渲染,但帧和选定的索引填充始终保持80%的亮度。奇怪的是,这种情况在7.1模拟器中没有发生,但在我的iPhone5和7.1.1上确实发生了

有没有人有过类似的问题?我读过许多其他关于控件不变暗的帖子,或者人们想为控件的不同部分设置不同的颜色,但找不到任何关于在全亮度下无法显示的颜色的帖子

我单独或一起尝试过的各种设置:

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;

谢谢您的帮助。

但这确实发生在我的iPhone 5 7.1.1上。您是否以某种方式玩过设置>常规>辅助功能?这里的一些设置可以显著改变你的颜色。在按钮形状、文本大小等出现之前,我已经打开了各种选项,但现在所有的设置都关闭了。我将其与同一操作系统上的iPad3进行了比较,相同的设置产生了不同的结果。。。iPad显示的UISegmentedControl具有正确的色调,就像模拟器一样。我丢失的电话一定有什么特别的东西。