Skip to content
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

How to custom the tabbar selectedItem's background color? #3

Closed
james-bltg opened this issue Apr 2, 2019 · 3 comments
Closed

How to custom the tabbar selectedItem's background color? #3

james-bltg opened this issue Apr 2, 2019 · 3 comments
Assignees
Labels
good first issue Good for newcomers question Further information is requested
Milestone

Comments

@james-bltg
Copy link

When I trying to apply this in my little Pj, I tried to custom the selectedItem's backgroundColor.
But I have no idea how to work it out.

Could you help me anyway?

Thanks

@AlbGarciam AlbGarciam added the question Further information is requested label Apr 2, 2019
@AlbGarciam
Copy link
Owner

AlbGarciam commented Apr 2, 2019

@MorLightJ There is no way to do that, because the way to notify the user that an item is selected is to have the text visible.

You can change text color or dot color by calling:

AnimatedTabBarAppearance.shared.dotColor = UIColor.red
AnimatedTabBarAppearance.shared.textColor = UIColor.red

Hope it helps you :)

@james-bltg
Copy link
Author

It Works.
I got a new problem, when I specify viewcontrollers for tabbar's controllers, it won't render until I tapped the tabbarItem.

the code here:

var items = [
AnimatedTabBarItem(icon: UIImage(named: "home") ?? UIImage(),
title: "Home", controller: Home.create() ?? Home()),
AnimatedTabBarItem(icon: UIImage(named: "search") ?? UIImage(),
title: "Stats", controller: Stats())
]

I made the initialIndex with 0, but the Home view didn't render,unless I tapped the Home tabbarItem.

How should I do to make it right??

@AlbGarciam AlbGarciam self-assigned this Apr 3, 2019
@AlbGarciam
Copy link
Owner

@MorLightJ There was an issue on the library. I have noticed on my app and I have fixed it 👍

Thanks for reporting it

@AlbGarciam AlbGarciam added this to the v.0.1.7 milestone Apr 3, 2019
@AlbGarciam AlbGarciam added the good first issue Good for newcomers label Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants