Nedim
Nedim

Reputation: 137

Xcode - How to change place of Tab Bar Item

I want the Contact icon on the left, what is the easiest way to do this?

enter image description here

EDIT: I found a simple solution.. I just had to delete the link between my Tab Bar Controller and the Bookmark page, then reconnect it to set it as second icon (on the right). See image: prntscr.com/b0hucd

Upvotes: 1

Views: 4756

Answers (3)

Amr Angry
Amr Angry

Reputation: 3831

Drag and drop should work

You can drag the contacts bar Item to the left to rearrange its position from the Storyboard.

Upvotes: 7

Ahmad Ishfaq
Ahmad Ishfaq

Reputation: 914

Try this code i used it to move the image in tabbar items to move vertically up.In this loop check that the index is 1 else it will move the bookmark icon also

for (UITabBarItem * item in tabBarController.tabBar.items) {
        item.image=[item.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        item.imageInsets=UIEdgeInsetsMake(item.imageInsets.top, item.imageInsets.left+20, item.imageInsets.bottom, item.imageInsets.right-20);
    }

Note: If it doesn't move the text let me know

Upvotes: 1

Stonz2
Stonz2

Reputation: 6396

UITabBar Class Reference

Check out the "items" property. (emphasis mine)

This property contains an array of UITabBarItem objects, each of which corresponds to a tab displayed by the tab bar. The order of the items in this property corresponds to the order of the items onscreen. You can use this property to access the items as needed.

Upvotes: 0

Related Questions