I couldn't find any way to create custom badge for UITabBarItem
. The only way to achieve this is to use custom UIButton/UIViews.
How to update default badge UI appearance in UITabbarController?
-
26-06-2022 - |
문제
As displayed above, default badge appears in red and white color. Can we change its color scheme and customize that view?
The only solution I found was, creating entire UITabbarController as custom control. Can't I use default control and only update badge or provide custom UI to badge?
해결책 2
다른 팁
You could just create view(UIButton
for example.) with the color (or background image) and text you want and add that to the tabbar on the place you want. But I think that would be some kind dirty implementation... Coz, you need to calculate the frame according to how many UITabbarItem
s you have. Otherwise, custom tabbar controller is the way to go :) I don't think customization of the default badge is possible. Good Luck!
제휴하지 않습니다 StackOverflow