How to remove the Tab top title on iOS? - ios

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)

Related

How to make Tab Bar Item disabled and how to change color and transparency for disabled Item

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.

How do I use both solid and outline icons in a tab bar like the App Store app?

I would like to have my tab bar similar to the App Store app (picture below). The active section has a coloured solid icon, and the other non-active sections will have the uncoloured outline icons. How can I switch from outline icon to solid icon depending on if it is selected or not? I would preferably want to accomplish this in interface builder but if thats not possible please explain how to do it in code. I have also provided a picture of my current tab bar. Notice how all of the icons are "outline" icons including the active section icon (I want the active section icon to be "solid"). I do have both the outline and solid icon sets, i'm just not sure how to use them both.
My current tab bar:
App Store tab bar (what I want but with my color not blue):
"You can use storyboard to set selected image of tabbar. I tried and it worked for me. Select the UITabbarItem and add a run-time attribute 'selectedImage', select Type as 'Image' and give the name of your image as its value."
iamge that shows how it's done
Had the same problem, answer from here: Setting Selected Image in Tab Bar Controller with Storyboard

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?
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.

removing some Grey Object on View Controller

I was trying to use navigation controller. But end up in adding some grey area on my view controller.
I have tried to remove it but failed.
I have checked if there is some navigation controller item has been added under my view but cannot find.
I cannot even click that item.
Can some one help me in removing this grey area. It was added when I was trying to add navigation bar controller from the library
I have added the image. Please check. I cannot remove it.
Actually I added the navigation controller but I think I cannot add it correctly.
Solved.
How
1) opened the Main.storyboard file in external editor i.e. Text Edit
tried to search which xml element with title equals to some button which is close to this like button 2 or 0
i found tool bar item which was added with mistake.
here is the code i removed it and it worked.
i have given two options to remove. Even if the code which is mentioned below in the heading Removed (2) is there , still they grey item will be shown there.
The annoying thing is ,we cannot select this item and it is no visible in the item hierarchy under the view.
Removed (1)
<toolbarItems>
<barButtonItem title="Back" width="103" id="732-cW-LpG">
<connections>
<segue destination="BEC-Jo-iar" kind="unwind" unwindAction="cancelToPlayersViewController:" id="ddb-5K-wuv"/>
</connections>
</barButtonItem>
</toolbarItems>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
Removed (2)

How to customize tab bar item image on runtime

I need to change the image of the tab bar item based on one of the option selected in my first tab at runtime. Whenever user changes the option the tab bar item image should change.
For example: I have 3 tabs. In first tab I have following options:
"Red"
"Green"
"Blue"
According to the option which user selects, the tab bar item image should change. (ie. for red, all 3 tabs should have red icons and so on)
How can I achieve this?
Thanks for helping :)

Resources