[英]Cannot set prompt color in iOS11
我試圖將iOS11中的導航欄提示顏色設置為與導航欄標題顏色相同的顏色。
這在iOS10中非常有用:
[[UINavigationBar appearance] setBarTintColor:[UIColor blueColor]];
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]}];
[[UINavigationBar appearance] setTranslucent:NO];
但是這不再適用於iOS11。 標題是白色但提示不是。
我發現一個線程提到了一個hack嘗試通過以下方式獲取提示標簽:
[UILabel appearanceWhenContainedInInstancesOfClasses:@[[UINavigationBar class]]].textColor = [UIColor whiteColor];
然而,這也不起作用。
有沒有其他人經歷過這個?
似乎是iOS 11中的一個錯誤
發布在Apple Developer論壇上:
https://forums.developer.apple.com/thread/85399
雷達問題(鏡像)34009213:
https://github.com/lionheart/openradar-mirror/issues/18233
似乎向Apple報道。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.