[英]How to remove icons on the UITabBar
基本上,我想刪除UITabBar上的默認圖標,只顯示標題。 此外,我希望將標簽欄的標題定位在標簽欄的中心,而不是默認標題欄。 有誰知道如何刪除圖標和中心標題? 謝謝!
Objective-C中的代碼
self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Tab1" image:nil selectedImage:nil];
[self.tabBarItem setTitlePositionAdjustment:UIOffsetMake(0, -10)];
像往常一樣,這在代碼中比在Interface Builder中更容易。
對於XCode 9.0和Swift 4.0中的Swift:
self.tabBarItem = UITabBarItem(title: "Your Title", image: nil, selectedImage: nil)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.