I want the Contact icon on the left, what is the easiest way to do this?
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
Drag and drop should work
You can drag the contacts bar Item to the left to rearrange its position from the Storyboard.
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
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.
Related
I have a tab group with two tabs. The tab name is being displayed two times, one under the tab icon on the bottom and one on the top of the app just under the status bar.
I want to remove the top tab title on iOS.
Thanks.
Regards
You can set navBarHidden:true to your Window inside the tab to remove the navigation bar.
Because you want the navbar to remain, and don't want a title. Don't set one! By default there is no title on the window, and window title and tabbar title are separate! This is how it should look after:
<TabGroup>
<Tab title="required">
<Window></Window>
</Tab>
</TabGroup>
Same structure can be applied when you use classic.
If you want to remove the title at some point instead of always, you can just call window.title = ""; and it will be removed. Of course replace "window" with the variable or alloy id (in which case it is $.id)
Is there a way to make chosen Tab Bar Item look disabled programmatically?
I have Tab Bar, almost everywhere its Items look active (it is delete, edit, search buttons). But on some pages some of its Items has to be inactive, showing user that he can't edit/delete anything here. I'm thinking, is there a way to change the visual appearance of chosen Tab Bar Item? Or better to use just set of the Buttons?
all active items/buttons in a bar, screenshot
all active items/buttons in the bar, screenshot
UPD: Desigion for disabling Item found, but when I make the Item disabled, I need to change its colour. Now it has the same color as UITabBar.appearance().unselectedItemTintColor but with transparency. Is there a way to change color and transparency for disabled Item (make it coloured differently and not transparent), keeping the colour for unselected Items?
For required tabbar item try to set false for .enabled property.
Obj-C
.enabled = NO;
Swift
.isEnabled = false
Alternatively, you could make your tabBar dynamic and instead of disabling/enabling, only show the relevant items. This way, the items are always nicely displayed and you don't have any gaps as you have in your screenshot.
I am trying to replace the bar button items in my toolbar with images. I was able to select image in the attribute inspector. But now the text is replaced with image. Is there anyway i can keep both text and image (text should be below image)
What i have is this.
Please click to see image
What i am looking for is something like this
Please click to see image
Thanks for helping.
You can place the image in the selected image attribute
And you can place the text in the bar item title attribute
Something like this
This can be done when you do to the navigation controller for that particular tab.. Like in your case navigation controller for item 1
Hope that helps
If I select a view with my mouse in a storyboard or xib, Xcode will select the front most view. I know that I can select the other views in the document outline, but if I want to grab a background view to move it with my mouse, the front most view gets selected again when I click in the storyboard.
I think there is a way to cycle through the views and select the ones in the back by holding down on some keys, but I can't find what it is. Does anyone know?
I'm using Xcode 4.6. I know that I can also move background views using the size inspector, but I'm looking for a way to position them with my mouse.
One way is to use the jump bar at the top of the editor. It's the control that shows the path of objects leading to the current selection.
Another way is to press control+shift and left click (or shift right click) an item. That shows you all of the objects under the mouse in a menu, and allows you to disambiguate the one you meant to select.
The good news: Place your mouse on the overlapped images, press and hold shift and right click the mouse. You should see the list of objects, select your object in the back. You can resize as you wish.
The bad news: you can only use the cursor arrows if you want to move it!
Select the view from the menu on the left of interface builder.
I need to center the B item with respect to the toolbar. I create the following in the interface builder:
It works fine until I dynamically insert additional items:
How can I maintain the centralized position of the B item? One idea was to use the Fixed Space Bar Button Items, but I couldn't, because the length of the toolbar changes as well (for different orientations).
You can use this every time the tab bar change the size:
//lets be tabBar the big view and buttonB the.. well, button B
[buttonB setCenter:CGPointMake(tabBar.frame.size.height/2, tabBar.frame.size.width/2);