UITabBarController 基本定製,uitabbarcontroller

來源:互聯網
上載者:User

UITabBarController 基本定製,uitabbarcontroller
UITabBarController 定製

 

特點

   

 

用法

1.準備好你的tabBar圖片及其他圖片(哈哈哈!!!!),我的圖片都放在了Assets.xcassets中.

2.匯入本工程中的Categroy檔案夾, 其中包含: HexColor.h/.m(設定顏色的), NSString+RenderingModel.h/.m(處理圖片,讓其保持本色或者預設的那種), UIColor+CreateImage.h/.m(填充tabBar的背景顏色), UIFont+fonts.h/.m(設定字型), UIView+SetRect.h/.m(處理frame), UIView+ glowView.h/.m (tabBarItem的右上方的小表徵圖).

3.剩下的就是在Appdelegate.m中實現你架構的建立.不理解的地方,可以看看下面的細節.

4.所建立的ViewController都是繼承的UIViewcController.

5.注意:我在首頁中隱藏了NavigationBar,  進入首頁的下一個頁面,我隱藏了tabBar,並定製了navigationBar.

由於前兩個頁面什麼都隱藏了,導致第二級頁面,什麼的都沒有了.

 

源碼

github:https://github.com/makingitbest/UITabBarController-Custom 

 

細節

1.調節UITabBarItem的字型的顏色和字型的大小

 

2.調節UITabBarItem的圖片與文字的位置

用法類似於此: [self setupController:controller tabBarItemType:kTitleImageType];

 

3.設定UITabBar的樣式:主要是改變背景

用法如此: [self tabBarController:tabBarController style:kCustomStyle];

 

4. 設定UITabBarItemBadgeValue(這個沒研究過)

用法如此:[self setupBadgeValueWithTabBarController:tabBarController atIndex:2];

 

5.導覽列與tabBar設定隱藏

 

6.自定製NavigationBarItem

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.