TabBarItem


這個是改變所有tabbar的設(shè)置文字顏色屬性(appearance)

后面帶有UI_APPEARANCE_SELECTOR的方法,都可以通過appearance對象來統(tǒng)一設(shè)置。

NSMutableDictionary*dis=[NSMutableDictionarydictionary];

dis[NSFontAttributeName]=[UIFontsystemFontOfSize:17];

dis[NSForegroundColorAttributeName]=[UIColorgrayColor];

UITabBarItem*Item=[UITabBarItemappearance];

[ItemsetTitleTextAttributes:disforState:0];

- (void)setTitleTextAttributes:(nullableNSDictionary *)attributes

forState:(UIControlState)stateNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

arc4random_uniform

隨機數(shù)

自定義的tabbar


UIButtonbutton與圖片尺寸一樣大

UIButton *but=[UIButton

buttonWithType:UIButtonTypeContactAdd];

[butsetBackgroundImage:@""forState:UIControlStateHighlighted];

but.frame=CGRectMake(0,0, but.currentBackgroundImage.size.width,but.currentBackgroundImage.size.height);

重寫tabbar改寫layoutsubviews方法(創(chuàng)建tabbar子類)

//kvc設(shè)置tabbar


//layoutSubviews, 當我們在某個類的內(nèi)部調(diào)整子視圖位置時,需要調(diào)用。




隱藏系統(tǒng)自帶的tabbar

self.navigationController.hidesBottomBarWhenPushed= YES;

- (void)viewWillAppear:(BOOL)animated

{

[superviewWillAppear:animated];

self.tabBarController.tabBar.hidden=YES;

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容