如下图QQ的界面所示,消息标签处红色角标如何实现?它与应用图标外的红色通知角标实现原理相同吗?
外部的角标代码是这样的:
[UIApplicationsharedApplication].applicationIconBadgeNumber =
2333;
这个 Tabbar 的角标是这样的:
UITabBarItem *item = [[
UITabBarItem alloc]
initWithTitle:@
"消息" image:nil tag:0];
customItem1.badgeValue = @
"3";
所以代码是不一样的。 Cell 那个,使用的是UILabel 设置背景颜色为红色和圆角可以实现。 然后改一下layer当中的corner 那个数值应该是你UILabel的一半
转载请注明原文地址: https://ju.6miu.com/read-659745.html