Search code examples
iosobjective-cuitabbartabbaruitabbaritem

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 belowenter image description here

But What I made now is below: enter image description here

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


Solution

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