3
A
回答
4
當然,只需製作較大文本的圖像即可。據我所知,這是唯一的方法。
1
是的,你可以用這樣一個空的圖像初始化它:
UIImage* image = [[UIImage alloc] init];
tabBarItem = [[UITabBarItem alloc] initWithTitle:title image:image tag:tag] ;
[image release];
只有標題文本將被顯示出來。
0
完整的解決方案在這裏。
您需要將空圖像設置爲tabBarItem。否則,tabBarItem將不會出現,直到您點擊它。
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.tabBarItem.title = @"Report";
self.tabBarItem.image = [[UIImage alloc] init];
}
return self;
}
定製UITabBar的:
- (void)customizeAppearance
{
[[UITabBar appearance] setBarTintColor:[UIColor blackColor]];
[[UITabBar appearance] setTranslucent:NO];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor whiteColor],
NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-Thin" size:22]}
forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName:RGB(0xff9700),
NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-Thin" size:22]}
forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitlePositionAdjustment:UIOffsetMake(0.0, -10.0)];
}
相關問題
- 1. 有可能讓UITabBarItem沒有圖像空間嗎?
- 2. 是否有可能讓我的RadioSelect有額外的文字
- 3. 是否有可能讓聲音更快?
- 4. 是否有可能更新現有的tiff目錄圖像
- 5. 是否有可能更改UITabBarItem徽章顏色
- 6. 是否有可能讓孩子顯示:沒有元素可見?
- 7. 是否有可能刪除UITabBarItem中的圖像並垂直對齊標題
- 8. 是否有可能讓javadoc忽略所有沒有文檔的類?
- 9. 當使用BannerViewController時沒有UITabBarItem圖像
- 10. UIImage/UITabBarItem沒有正確加載圖像
- 11. 有沒有更有效的方法呢?
- 12. 有沒有辦法讓這個圖像綁定更高性能?
- 13. 是否有可能使圖像居中?
- 14. 是否有可能將圖像和文字放在Segmentcontrol中?
- 15. 是否有可能使文本無效,但在android上的自定義視圖上沒有背景圖像?
- 16. UITabBarItem沒有的UITabBarController
- 17. 是否有可能$ _GET沒有ID?
- 18. 是否有可能/建議讓用戶沒有自己的主文件夾?
- 19. 是否有可能更新沒有「ID」的Sharepoint列表?
- 20. 是否有可能在Drupal的內容節點上方有大圖像?
- 21. 是否有可能具有恆定的旋轉DIV或圖像?
- 22. 有沒有辦法更改UITabBar或UITabBarItem中的文本位置?
- 23. 是否有可能在Android中創建沒有xml的視圖?
- 24. 是否可以加載沒有圖像名稱的圖像?
- 25. 是否有可能減小來自字節數組的圖像的大小
- 26. 是否有可能在沒有ImageIO的情況下閱讀圖像?
- 27. 是否有可能更新使用hql沒有子查詢..?
- 28. 是否有可能檢測到重複的圖像文件?
- 29. HTML - 圖像上沒有css的文字可能?如何?
- 30. 是否有可能讓perforce的行爲像顛覆?