麻花豆传媒剧国,亚洲国产精品无码,欧州黄片视频免费观看,外国性生活一区二区

問答

如何在 iOS 7 獲得導航欄上的模糊和半透明效果

提問者:jiepai07342016-09-08 00:00

最佳答案

半透明在我的 UINavigationController 的子類,我使導航欄半透明:- (id)initWithRootViewController:(UIViewController *)rootViewController{ if (self = [super initWithRootViewController:rootViewController]) { self.navigationBar.translucent = YES; } return self;}色調顏色在我的 UIApplicationDelegate 的子類,我設置導航欄中的色調顏色。我發現色調顏色的 alpha 沒有區別。也就是說,使用 alpha 0.1 不會導致要變得更透亮的欄。- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UINavigationBar appearance] setTintColor:[UIColor greenColor]];}邊緣在我的內容視圖控制器中,我將設置邊緣為 UIRectEdgeNone 這樣頂部的導航欄不會砍。如果要使用默認的 UIRectEdgeAll ,導航欄將會永久地蓋頂部的我的內容。即使我要住在一起這種異常, UIRectEdgeAll 仍然不會啟用半透明效果。- (void) viewDidLoad{ [super viewDidLoad]; self.edgesForExtendedLayout = UIRectEdgeNone;}編輯: 試驗與邊緣@rmaddy 在評論中所指出的廣告問題可能與 edgesForExtendedLayout。我發現綜合教程 edgesForExtendedLayout ,并試圖實現它:- (void) viewDidLoad{ [super viewDidLoad]; self.edgesForExtendedLayout = UIRectEdgeAll; self.automaticallyAdjustsScrollViewInsets = YES; self.extendedLayoutIncludesOpaqueBars = NO;}它不工作。首先,那里是沒有半透明效果。第二,我的內容的頂部被切掉。在上面的代碼與以下示例頁上,神通最初由導航欄和它是很難向滾動。你可以拉下,看到頂部的化身,但當你放開,頁面會自動彈起來,神通將會再次被遮掩。解決方法 1:問題是由第三方拉下來刷新視圖EGORefreshTableHeaderView,而普遍地使用了之前的 iOS 6 介紹系統刷新控制引起的。這種觀點混淆了 iOS 7,讓它認為內容是比真的很高。Ios 6 和 7,我已經有條件地切換到使用UIRefreshControl。現在的導航欄不會砍掉我的內容。我可以使用 UIRectEdgeAll ,使我下面的導航欄的內容走。最后,顯示我的導航欄與較低的 α 要獲得半透明效果色調圖。// mostly redundant calls, because they're all defaultself.edgesForExtendedLayout = UIRectEdgeAll;self.automaticallyAdjustsScrollViewInsets = YES;self.extendedLayoutIncludesOpaqueBars = NO;[[UINavigationBar appearance] setTintColor:[UIColor colorWithWhite:0.0 alpha:0.5]];

回答者:qg25se41oc2016-09-10 00:00

相關問題

車友關注

最新標簽

按字母分類:
ABCDEFGHIJKLMNOPQRSTWXYZ0-9