UISegmentedControl with badge number

后端 未结 3 1293
一个人的身影
一个人的身影 2021-02-09 13:33

Just like the tabbar, I want to show badge on UISegmentedControl. As I cant see any predefined methods for UISegmentedControl just like available for <

3条回答
  •  面向向阳花
    2021-02-09 13:59

    Here is a little third party library I've used to draw badges on various things. It's pretty nice. For example, changing the color of the badge to match my design was trivial.

    Once you bring this class into your project and include it into your view controller, you go:

    CustomBadge *customBadge1 = [CustomBadge customBadgeWithString:@"Badge 1"];
    

    ...and then add customBadge1 as a subview of whatever thing you're badging.

提交回复
热议问题