jkpang / PPBadgeView

iOS Custom Badge, Support UIView, UITabBarItem, UIBarButtonItem ,Support Objective-C/Swift; iOS自定义Badge组件, 支持UIView, UITabBarItem, UIBarButtonItem, 支持Objective-C/Swift
MIT License
848 stars 118 forks source link

Grow badge on left if needed #8

Open jdanthinne opened 6 years ago

jdanthinne commented 6 years ago

Hi! I'm trying to align the badge text to the right, but I'm unable to… If you look at the screenshot, you'll see that the badge, when higher than 10, is touches the end of the screen. How can I tell the badge to grow on the left instead of right, or at least stay centered on the original badge center position?

simulator screen shot - iphone x - 2018-01-24 at 15 22 43

jkpang commented 6 years ago

I'm so sorry, I'm very busy this time. Now I add a API, and you can call it: Objc: - (void) pp_setBadgeFlexMode: (PPBadgeViewFlexMode) flexMode; Swift: func setBadge (flexMode: PPBadgeViewFlexMode =.tail) { }. To change the pattern of Badge flex, example:

image @jdanthinne