Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以通过在“样式”下拉菜单中选择一个选项来在 xib 文件中执行此操作,例如。“黑色半透明”。我怎样才能以编程方式做到这一点?
谢谢
在要设置它的视图控制器中,将以下内容添加到viewDidLoad:
viewDidLoad
[self.navigationController.toolbar setBarStyle:UIBarStyleBlackTranslucent];
尝试设置UIToolbar.barStyle和UIToolbar.translucent。
UIToolbar.barStyle
UIToolbar.translucent