-2

New to Swift and Stack Overflow! Found similar post(s), though the answers were still not enough guidance for me to figure it out. So would really appreciate if a bit more detailed guidance can be provided.

I would like to create a tab bar with 5 tab items, with the middle tab item essentially a centre round add button similar to this:

Example

I have seen a post that seems to suggest that I don't need to use an actual button element, as I can just change the icon to white when the icon is selected, and create a circle in the background of the middle tab item...Except I'm so new to this that I cannot figure out how to do either. I've only managed to customise tab colors when the item is active or inactive.

Can anyone help please?

Sorry it's a basic question. Much appreciated for your input.

1 Answers1

0

if you have whatever image you want to be your tab bar image in your assets, you can do this in the storyboard. You need to add a tab bar controller, and connect whatever views you want to be for each tab by holding down control from tab bar controller and choosing a view controller/nav controller and choosing the relationship segue (view controllers).

enter image description here

then clicking on that view controller you just made a tab, there should be a tab at the bottom. click on the tab image and in the right panel you can edit title and image. choose your image and you should be all set.

enter image description here

  • Hi! Thanks for your input. Sorry I wasn't clear. What I'm struggling with isn't connecting views with the tab bar controller, but rather - how do I create the 'add' button in the centre, especially since the circle is a different size from all the other tab icons? Just for curiosity, what if I also want to create drop shadow on this 'add' button? Thanks! – alwaysbelearning Sep 20 '20 at 09:13
  • what happens if you set the blue plus button from your example as the tab image? that isnt what you are looking for? – Michael Montalbano Sep 22 '20 at 19:41