0
我需要在突出顯示時更改UITabBarItem的圖像和文本位置。可能嗎?如何更改UITabBarItem位置?
我需要在突出顯示時更改UITabBarItem的圖像和文本位置。可能嗎?如何更改UITabBarItem位置?
看起來沒有辦法改變UITabBarItem的圖像位置。我只是糾正了我選擇的圖像具有按鈕約15個,糾正的TabBar 15 UITabBarItem的標題的位置:didSelectItem:我自定義的方法的UITabBarController:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
// If there is another selected item set default properties to it.
for (int counter = 0; counter < [self.tabBar.items count]; counter++) {
UITabBarItem *currentSelectedItem = [self.tabBar.items objectAtIndex:counter];
[currentSelectedItem setTitlePositionAdjustment:UIOffsetMake(0, 0)];
}
// Set selected item.
UITabBarItem *selectedItem = item;
[selectedItem setTitlePositionAdjustment:UIOffsetMake(0, -15)];
}