UISegmentedControl with badge number

后端 未结 3 1282
一个人的身影
一个人的身影 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 14:09

    I had this problem today, so I've put together a UISegmentedControl subclass which allows you to easily set badge numbers on each of the segments.

    Using it's as easy as:

    [segmentedControl setBadgeNumber:1 forSegmentAtIndex:0];
    

    Screenshot, documentation and source code are at https://github.com/dave-thompson/MESegmentedControl .

提交回复
热议问题