I want to change background color of UITabBarItem
badge but can't find any resource on how to make it.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
I have the same problem and solved it by creating a little category that replace the BadgeView with an UILabel that you can customize easily.
https://github.com/enryold/UITabBarItem-CustomBadge/
Changing the badge-color is now natively supported in iOS 10 and later using the
badgeColor
property inside yourUITabBarItem
. See the apple docs for more infos on the property.Example:
myTab.badgeColor = UIColor.blue
[myTab setBadgeColor:[UIColor blueColor]];
YES, But the only possible solution is to create a custom Tabbar and creating your custom tabbar badge icon. You will find many article/code for creating custom tabbar.
For people using Swift, I managed to improve on TimWhiting answer in order to have the badge view working on any screen size and any orientation.
UITabBarItem
has this available since iOS 10.It's also available via appearence.
reference docs: https://developer.apple.com/reference/uikit/uitabbaritem/1648567-badgecolor