簡體   English   中英

iOS中的透明導航欄和標簽欄

[英]Transparent Navigation Bar & Tabbar in iOS

我想要透明的導航欄和標簽欄以查看背景(參考圖像==> https://www.dropbox.com/s/3vn8ef0p5lv1cw7/Required.png?dl=0 )。 我已經在設置背景了。 但是,我無法使Navigation Controller和Tabbar Controller透明(參考圖像==> https://www.dropbox.com/s/vfewqpwve78l4dq/Current.png?dl=0 )。

這是我之前嘗試過的方法:1.將導航欄和選項卡的背景色設置為null /清除顏色。 2. BarTintColor適用於導航欄,但它僅允許我設置顏色,不能具有clearcolor(嘗試時將其設置為黑色)3.半透明屬性!

請幫忙。 提前致謝。

嘗試為導航欄和標簽欄設置透明的背景圖像。 這肯定會解決您的問題。

UIImage *image = [UIImage imageNamed:@"NavigationBar.png"];
    [navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];

更新:

[self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationBar.shadowImage = [UIImage new];
self.navigationBar.translucent = YES;

暫無
暫無

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

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