UINavigationBar 結構

UINavigationBar的結構示意圖以下所示:(ios7+)ios

 

不一樣的app,對界面的設計風格都不同,只有精確瞭解UINavigationBar的結構圖,才能很好的使用它api

    //config for UINavigationBarapp

    [[UINavigationBar appearance]  setBackgroundImage:[UIImage imageNamed:@"transparentBg"]函數

                       forBarPosition:UIBarPositionAnyspa

                           barMetrics:UIBarMetricsDefault];設計

//setShadowImage 須要和 setBackgroundImage 同時使用才生效it

    [[UINavigationBar appearance] setShadowImage:[UIImage new]];io

    //設置了BackgroundImage 就不要去設置BackgroundColor了ios7

//    [[UINavigationBar appearance] setBackgroundColor:[UIColor navBackgroundColor]];方法

    //也能夠不用設置BarTintColor

//    [[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];

    [[UINavigationBar appearance] setBackIndicatorImage:[UIImage imageNamed:kNavButtonBackOnImage]];

    [[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:[UIImage imageNamed:kNavButtonBackImage]];

    

    [[UINavigationBar appearance] setTitleTextAttributes:nil];

    [[UINavigationBar appearance] setTintColor:[UIColor blueColor]];

具體函數的含義查看系統api方法

 

UITabBar的使用也是相似的

相關文章
相關標籤/搜索