7

When I set the bottom UIToolbar to black on the view controller, it appears as a more greyish colour (the same thing happens with other colours--it sort of fades them out). What I assume is happening is that in iOS7 the toolbar seems to adapt the colour of what is beneath it (currently white) which makes for the duller colour.

I've updated the view controller so that the "extended edges" options are turned off but still get this effect. Has anyone else had this issue yet?

UPDATE: I resolved the issue by setting the background colour of the UIToolbar to black (something I haven't had to do in previous versions of iOS). If anyone can think of a better solution, let me know.

4

3 回答 3

13

iOS 7 中的所有工具栏和导航栏都有一个translucent属性。

这会导致效果,背景以模糊的形式闪耀(就像控制中心一样)。

刚设置YourToolbar.translucent = NO;

于 2013-09-20T00:39:06.540 回答
10

将 t* ranslucent 属性设置为 NO *:-

在 iOS 7 中,您需要设置barTintColor属性-

UIToolbar *doneToolbar=[[UIToolbar alloc]initWithFrame:CGRectMake(0, 584, 320, 44)];
doneToolbar.translucent=NO;
doneToolbar.barTintColor=[UIColor blackColor];
[self.view addSubview:doneToolbar];

我用过它工作正常...

于 2014-01-13T05:22:45.323 回答
5

设置背景颜色而不是条形色调对我有用

我将条形颜色设置为默认值,将半透明属性设置为 NO,将背景设置为我想要的颜色,这对我有用。

于 2014-01-21T21:41:13.977 回答