UISegmentedControl with icon number

Like the tab, I want to show the icon on UISegmentedControl. Since I do not see any predefined methods for the UISegmentedControlsame as available for UITabBar.

alt text

I was thinking of adding an icon as an image just on top of it, but maybe there is a better way.

+5
source share
3 answers

Here is a small third-party library that I used to draw icons on various things. This is pretty nice. For example, changing the color of the icon in accordance with my design was trivial.

Once you bring this class to your project and include it in your controller, you:

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

... customBadge1 , .

+12

, UISegmentedControl, .

, :

[segmentedControl setBadgeNumber:1 forSegmentAtIndex:0];

, https://github.com/dave-thompson/MESegmentedControl.

+6

- . , . , .

0

All Articles