[英]Why is the top of a black translucent UIToolbar different from a black translucent UISearchBar, and how can I make them look the same?
[英]UIToolbar to have translucent and not black color
什么是最簡單的方法(如果可能的話,不使用drawRect,子類,類別)有一個透明的UIToolbar沒有黑色,我自己選擇的顏色? 我知道你可以設置UIToolbar的半透明屬性,但顏色是黑色,我嘗試設置背景顏色,但它不起作用。 我嘗試設置背景圖像,它可以工作,但它不透明。
看看setTintColor:
方法。 例如:
[self.navigationController.toolbar setTintColor:[UIColor greenColor]];
嘗試使用IB,它應該工作:
代碼示例的答案可以在這個問題中找到: UIToolBar不能透明嗎?
西巴
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.