UIAppearance setTranslucent错误:非法属性类型,c表示外观设置器,_installAppearanceSwizzleForSetter [英] UIAppearance setTranslucent error: Illegal property type, c for appearance setter, _installAppearanceSwizzleForSetter

查看:182
本文介绍了UIAppearance setTranslucent错误:非法属性类型,c表示外观设置器,_installAppearanceSwizzleForSetter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试用iOS 7:

[[UINavigationBar appearance] setTranslucent:NO];

遇到崩溃和错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** Illegal property type, c for appearance setter, _installAppearanceSwizzleForSetter:'
*** First throw call stack:
(0x16ad9b8 0x142e8b6 0x16ad7ab 0x72163d 0x724c34 0x169daca 0x169d8de 0x6c09 0x228ea9 0x2296e9 0x22ab5e 0x240a6c 0x240fd9 0x22c7d5 0x35a4906 0x35a4411 0x16293e5 0x162911b 0x1653b30 0x165310d 0x1652f3b 0x22a2b1 0x22c4eb 0x6f3d 0x1d0d725)
libc++abi.dylib: terminating with uncaught exception of type NSException

其他通话工作正常:例如。

Other calls work fine: eg.

[[UINavigationBar appearance] setBarStyle: UIBarStyleBlack];

当我在本地设置半透明时,它不会崩溃:

When I set the translucency locally, it does not crash:

[self.navigationController.navigationBar setTranslucent:NO];

我假设这是特定于iOS 7,但在iOS中没有试过相同的东西6尚未。

I'm assuming this is specific to iOS 7, but haven't tried out same thing in iOS 6 yet.

推荐答案

[[UINavigationBar appearance] setTranslucent:NO] 

它不适用于iOS 6.它仅适用于iOS 7以上版本。

It is not available iOS 6.It is only available in iOS 7 onward.

这篇关于UIAppearance setTranslucent错误:非法属性类型,c表示外观设置器,_installAppearanceSwizzleForSetter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆