ios自訂UINavigationController

來源:互聯網
上載者:User

標籤:

 1 #import <UIKit/UIKit.h> 2  3 @interface NJNavigationController : UINavigationController 4  5 @end 6  7  8  9 #import "NJNavigationController.h"10 11 @interface NJNavigationController ()12 13 @end14 15 @implementation NJNavigationController16 17 18 19 // 當該類第一次用到的時候就調用20 + (void)initialize21 {22 //    NSLog(@"initialize");23     // 3.設定導航條的主題24     // 如果要同時設定很多UINavigationBar的樣式, 可以通過設定UINavigationBar的主題的方式來設定以便簡化代碼25     UINavigationBar *navBar = [UINavigationBar appearance];26     // 3.1設定所有導航條的背景圖片27     // 判斷當前啟動並執行作業系統的版本28         [navBar setBackgroundImage:[UIImage imageNamed:@"NavBar64"] forBarMetrics:UIBarMetricsDefault];29     30     // 3.2設定所有導航條的標題顏色31     NSMutableDictionary *md = [NSMutableDictionary dictionary];32     md[NSFontAttributeName] = [UIFont systemFontOfSize:16];33     md[NSForegroundColorAttributeName] = [UIColor whiteColor];34     [navBar setTitleTextAttributes:md];35 36 }37 38 - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated39 {40 //    NSLog(@"pushViewController");41     42     // 拿到目標控制器(即將要入棧的控制器), 設定它的自動隱藏tabbar43     viewController.hidesBottomBarWhenPushed = YES;44     [super pushViewController:viewController animated:animated];45     46 }47 48 //- (UIViewController *)popViewControllerAnimated:(BOOL)animated49 //{50 //     return [super popViewControllerAnimated:NO];51 //}52 @end

 

ios自訂UINavigationController

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.