这会导致应用崩溃:
[[UINavigationBar appearance] setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)
有没有办法用外观做到这一点?
RyJ*_*RyJ 66
这有效:
NSDictionary *textTitleOptions = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor darkGrayColor], UITextAttributeTextColor, [UIColor whiteColor], UITextAttributeTextShadowColor, nil];
[[UINavigationBar appearance] setTitleTextAttributes:textTitleOptions];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25303 次 |
| 最近记录: |