Empty gaps between UITabBar elements? - ios

I'm having an issue with my UITabBar:
This is what it looks like in its different states:
As you can see, there's little empty areas between my elements and on the sides:
My Question is why isn't it like on the App Store app, where you do not have side or in between elements gaps?
And this is how I am changing the appearance of the Tab Bar, with a background image that does NOT have any dividers:
[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:#"UITabBarBG"]];
Following a method like explained here wouldn't work because of the gaps I have:
http://blog.erikvdwal.nl/blog/2012/09/25/customizing-the-uitabbar-in-ios-5-and-ios-6/
Any help would be helpful!
Thanks!

If you make your images are larger you will not have this issue, they can even overlap if you want the same separators as in the AppStore app.
See How can I add a custom divider image to the UITabBar?

Related

how to create day/night mode for my app

I am looking to create a toggle in my application
Day | Night
Day is considered the default setting. When the user selects the Night mode i want all the color of all the UI elements to be inverted.
Here are the kind of elements i mean:
UILabels
Buttons
Tabs
Pickers
Window Backgrounds
Everything else that is a UI object
I have tried using the following:
[[UIApplication sharedApplication] keyWindow].tintColor = [UIColor redColor];
This has the following issues:
This does change the color of many elements of the app but not
all. Like for instance it does not change the color of the UILabels
It does not invert the color. It simply changes the color for all
the object to a particular value.
Does not change the background color of the window.
Is this even possible with a quick bit of code?
You need use the UIAppearance for customize your labels, buttons, etc.
You can see this tutorial. I think this can help you.

iOS) How to add a divider(==separator) between tabbarItems

I searched this question many times but couldn't get enough information.
So I will use UIButton or UIView to replace UITabbar for customizing issue.
I want to put divider(separator) between two tabbarItems and bottom lines like the image below
But What I made now is below:
How can I make it as I want?
I did customize many view components(UIViewcontroller, UIButton, UITextfiled,UITableViewCell,UICollectionViewCell) but I don't know how to customize tabbarItem
I'm afraid there is no specific option to set a divider in UITabBar. But you can always use a custom tab bar. You can check this out, it has a special property for seperator image:
NMBottomTabBarController for iOS
There is also another option. You may like this :) I also used it myself in one of my app. I made an image that looks like a tab bar with seperator as a background image. Then put the items on it. Easy peasy. For example check this image:
Image Link
I hope this helps.

iOS Tab Bar questions (Swift)

I have a couple questions about the iOS tab bar.
My first question is, is the image always tinted automatically? Say for example, I used an image that was colored red, is there a way to get it to show the red without tinting it? I guess what I am saying is, can you show the natural color?
My second question is, assuming the tinting is mandatory, how would I go about tinting the images in the tab bar that are not the currently selected image? I have the selected image tint figured out.
I tried changing the tint under, UIView.appearance() I believe and that worked, but when I selected a different tab, and then navigated back the color went back to the former grayish color.
If I am not being clear enough, let me know and I will explain more. I am using swift, so any examples you give would be great in swift! Thanks!
Say for example, I used an image that was colored red, is there a way to get it to show the red without tinting it?
What you want to do is to specify an image with rendering mode .AlwaysOriginal.
To govern both images, create the item with initWithTitle:image:selectedImage: and make them both .AlwaysOriginal.
(As you discovered, if you use a transparency mask and rely on the tintColor, you lose control of the tint color when unselected.)

Unusually cool looking tab bar setup within a rootviewcontroller of a UISplitView

The ABC (Australian Broadcasting Corporation) iView app for iPad, has great looking tab like setup within a rootViewController of a UISplitView.
The tabs named "Browse/Watch/Listen" are particularly interesting are they simulated or real tabs?
It's unlike any UITabBar I've seen around in iPad apps.
Does anyone know how something like that is possible?
The round rect button in custom mode will be transparent and any png image will maintain in transparencies.
3 or more buttons with transparent images would be the way to go. A different color for when they are selected and your all set. You could also make them look like they are overlapping with images that continue the button next to it.
With the iOS devices it is more about appearance and less about the underlying functionality.
This is a custom control, they made themselves from scratch.
Fortunately for you, you don't need to make it from scratch. :)
There's a lot of open source component that does just this, just like these ones.
Those tabs look and feel like 3 UIButtons. Notice how the UI highlight acts when touching the buttons, and the action is only triggered on touchUpInside.
The tab content is probably a UITableView which gets refreshed when switching tabs.

Customizing UITabbar idea ?

I read many posts on customizing color of selected tabbar item which is actually blue by default.
My idea was to put an UIImageView on each of my button.
Once the user select one button, I would then display the image (which is the same icon but with another colour as a gradient).
What do you think about that ?
Thanks in advance
You could always use this http://idevrecipes.com/2011/01/04/how-does-the-twitter-iphone-app-implement-a-custom-tab-bar/ and change it to include text and modify the colour.
Thankfully, iOS 5 introduced an appearance proxy allowing customisation of most basic UI elements, including the trusty UITabBar. The proxy is used to change ALL instances of a class throughout an application. However, with this came some basic properties available for specific instances.
See the selectedImageTintColor property of UITabBar for your needs.
Other appearance additions for this class are tintColor, backgroundImage and selectionIndicatorImage.

Resources