Sheriff0.3.2

Sheriff0.3.2

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2015年12月

Mike Amaral维护。



Sheriff0.3.2

Sheriff - by Gemr

标签化任何内容。

demo

入门指南

在Podfile中添加pod 'Sheriff',然后运行pod install

使用起来有多简单?

// Create your badge and add it as a subview to whatever view you want to badgify.
GIBadgeView *badge = [GIBadgeView new];
[myView addSubview:badge];

// Manually set your badge value to whatever number you want.
badge.badgeValue = 5;

// Or increment and decrement to your heart's content.
[badge increment];
[badge decrement];

自动处理显示和消失标签的动画。将标签值设置为一个正的非零整数将显示标签,反之,任何小于或等于零的值将消失标签。

很简单,不是吗?

我可以自定义它吗?

当然可以...

badge.font = [UIFont fontWithName:@"OpenSans-Semibold" size:18];
badge.textColor = [UIColor whiteColor];
badge.backgroundColor = [UIColor colorWithRed:49/255.0 green:69/255.0 blue:122/255.0 alpha:1.0];

demo

如果你想偏移标签,因为它没有放置得恰到好处:

badge.topOffset = 10;   // Moves the badge down 10 points.
badge.rightOffset = 10; // Moves the badge right 10 points.

许可证

源代码在MIT许可证下提供。