簡體   English   中英

更改導航控制器底部工具欄的顏色

[英]Changing the colour of Navigation Controller bottom toolBar

我正在嘗試更改導航控制器底部欄的顏色。 我設法通過添加以下內容來更改appdelegate中頂部的NavBar

[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0.688 green:0.437 blue:0.794 alpha:1.0]];

我也想將其應用於底部欄。

您可以使用[UIToolbar appearance]設置UIToolbar的外觀

祝好運

我遇到了同樣的問題,但是可以通過在情節提要中為我的navigationBar設置標簽來避免此問題。 然后,我可以像這樣更改navigationBar的顏色:

讓navigationBar =(self.view.viewWithTag(someNumber)as UINavigationBar)navigationBar.barTintColor = UIColor.blackColor()

除非您可以保證視圖中的子視圖數量少於“ someNumber”,否則這是不理想的。 如果可以,那么應該可以。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM