- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在我的 iOS7 应用中使用 [tabBarController.tabBar setTranslucent:NO];
。但是,我希望代码使用 xcode 4 进行编译。
所以我在运行时检查iOS版本
float ver = [[[UIDevice currentDevice] systemVersion] floatValue];
if (ver >= 7.0) {
在 Xcode 4 中使用 [tabBarController.tabBar setTranslucent:NO];
会产生错误..
'UITabBar' 的可见@interface 声明选择器'setTranslucent:'
因为 setTanslucent 在 iOS6 中不可用。
我已经尝试了很多次,但要么代码没有运行,要么导致错误...
//UITabBar *tabBarr = [tabBarController tabBar];
//if ([tabBarr respondsToSelector:NSSelectorFromString(@"setTranslucent")]) {
// [tabBarr setValue:NO forKey:@"setTranslucent"];
//}
//if ([tabBarr respondsToSelector:@selector(setTranslucent:)]) {
// [tabBarr setTranslucent:NO];
//}
// tabBarController.tabBar.superview.backgroundColor = [UIColor clearColor];
//if ([tabBarr respondsToSelector:@selector(setTranslucent:)]) {
//if ([[tabBarController.tabBar class] instancesRespondToSelector:@selector(setTranslucent:)]) {
//[tabBarController.tabBar setTranslucent:NO];
//[tabBarController.tabBar setBool:NO forKey:@"setTranslucent"];
// [tabBarController.tabBar setValue:NO forKey:@"setTranslucent:"];
//}
我不确定还能尝试什么?
最佳答案
您可以创建一个类别并再次定义属性
@interface UITabBar (OldSDKCompatibility)
@property(nonatomic,getter=isTranslucent) BOOL translucent;
@end
关于ios - Xcode 4 + 5 兼容代码使用 tabBar setTranslucent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19125955/
我已将自定义颜色设置为 QLPreviewController 的导航栏但问题是我想要 QLPreviewController 中导航栏的深色即使我已将导航栏半透明属性设置为否但我不知道为什么它不起作
与 this 相同的问题,但这个问题被回避了(因为当时的保密协议(protocol))并且不再有效。 *** Terminating app due to uncaught exception 'NS
我试图让我的 UINavigationBar 和 UIStatusBar 不透明并且没有任何半透明属性。我尝试使用 [[UINavigationBar appearance] setTransluce
我正在尝试在我的 iOS7 应用中使用 [tabBarController.tabBar setTranslucent:NO];。但是,我希望代码使用 xcode 4 进行编译。 所以我在运行时检查i
这个问题在这里已经有了答案: iOS 7 : Disable UINavigationBar Translucency For Entire App (9 个回答) 关闭 9 年前。 我有一个 UI
试用 iOS 7: [[UINavigationBar appearance] setTranslucent:NO]; 出现崩溃和错误: *** Terminating app due to unca
我是一名优秀的程序员,十分优秀!