【发布时间】:2013-11-12 09:39:05
【问题描述】:
我正在尝试在我的 ios 7 应用上使用模糊效果。我使用了UITabBar blur 技巧,它只在模拟器上运行良好,但在真正的 ios7 设备上运行良好。我正在使用已经在使用 ios 7 的 iPad 3。
我是不是忘记了什么?我需要它在 ios 7 设备上工作。
在构建设置中,我的配置
- 基础 SDK:iOS 7.0
- 部署目标:iOS 6.0
这里是来源:
if (![catlistView viewWithTag:23] && [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.) {
categoryListBackground.backgroundColor = [UIColor clearColor];
UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:categoryListBackground.frame];
bgToolbar.barStyle = UIBarStyleDefault;
bgToolbar.tag = 23;
bgToolbar.barTintColor = [UIColor colorWithRed:240./255. green:243./255. blue:243./255. alpha:0.9];
[catlistView insertSubview:bgToolbar atIndex:0];
}
【问题讨论】:
-
你试过加
[bgToolbar setTranslucent:YES];吗? -
@zbMax 它不起作用
-
这很奇怪,因为指导方针说:
In iOS 7, a translucent element blurs only the content directly behind it... -
是的,这个技巧总是有效的,我在我的其他应用程序中使用它。这是我第一次遇到这样的事情。
-
如何将 barstyle 设置为
UIBarStyleBlack或UIBarStyleBlackTranslucent然后更改 bar tint 颜色?
标签: ios objective-c ipad ios-simulator