MIBadgeButton 是一个使用 Swift 编写的徽章按钮,具有高 UITableView/UICollectionView 性能。
将 MIBadgeButton 添加到 Storyboard 或使用 frame 初始化
button.badgeString = "120"
设置 EdgeInsets 以更改徽章的默认位置(可选)
button.badgeEdgeInsets = UIEdgeInsetsMake(10, 0, 0, 15)
更改徽章文本颜色和背景颜色
button.badgeTextColor = UIColor.blueColor()
button.badgeBackgroundColor = UIColor.redColor()
Mustafa Ibrahim, [email protected]
为 iOS 8 设计。
MIBadgeButton 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。