CosmicMind / CosmicMind/Material

TabBar Item Customization

Open
#1,266 6 comments 0 reactions 1 assignee Claimed by @daniel-jonathan View on GitHub
material
Dominant language
Swift
Stars
12k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Normally Tab Items takes equal spacing. But according my design I need to change this behavior. Tab Items should take only the space it needs. Also Is there any option to modify the radius of the line as my design has this modification.

This is what I have tried:

[let tabBar = TabBar()
tabBar.delegate = self

tabBar.dividerColor = Color.clear


tabBar.lineColor = Colors.wiseMagenta!
tabBar.lineAlignment = .bottom

tabBar.backgroundColor = Color.clear
tabBar.tabItems = buttons

tabBar.tabBarStyle = .nonScrollable
tabBar.tabBarCenteringStyle = .never
tabBar.tabItemsInterimSpace = 0
tabBar.tabBarLineStyle = .auto

tabBar.frame = CGRect.init(x: 0, y: 0, width: 200, height: 43)

let rightBarButton = UIBarButtonItem(customView: tabBar)
self.navigationItem.leftBarButtonItems = [rightBarButton]]

**My target Design:**
![Screenshot 2019-09-15 at 3 10 37 PM](https://user-images.githubusercontent.com/17532073/64919315-13153280-d7cb-11e9-9a02-bf0f65a4c337.png)

**Result I am getting:**
![Screenshot 2019-09-15 at 3 13 35 PM](https://user-images.githubusercontent.com/17532073/64919347-9171d480-d7cb-11e9-9b02-feea393e180a.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.