-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TabBar Item Customization #1266
Comments
I have tried giving width to my TabItem but didn't work
|
I have managed to change the line width with the following code.
But that has created another issue. As tab item is taking an equal space of other item and so it creates padding from the left. |
I have managed to add a cornerRadius to tabBar line using tabBar.line property. But could not remove the gap at the beginning |
Hi @ahsanaasim can you send me your current project to test this out? I will see if I can help you out with a solution. Thank you! |
@ahsanaasim I was able to accomplish the desired look, however, it was at the cost of modifying the internal TabBar code. So if you choose to go down this path you will need to support your own updates to keep the look consistent. Here is how you can pull it off...
Then it's just a matter of playing with the values to get your desired look. I hope this helped - demonstration below. I am going to close this ticket for now :) |
Thank you @adamdahan, a really helpful solution. I'd like to make sure that the API is not limited in this case, or if you have not seen the correct API configuration to use. We will update this issue within a day or two. For now, I would suggest to play with @adamdahan's solution, so you are not blocked. |
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
My target Design:
Result I am getting:
The text was updated successfully, but these errors were encountered: