search

Home  >  Q&A  >  body text

iOS开发 关于未读消息的红色角标

如下图QQ的界面所示,消息标签处红色角标如何实现?它与应用图标外的红色通知角标实现原理相同吗?请尽可能详细的描述一下

高洛峰高洛峰2816 days ago735

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 13:17:34

    Damn it, when I came in, I saw that I was an acquaintance. . . I haven't done this, but I think I've seen it.

    The external subscript code is as follows:

        [UIApplicationsharedApplication].applicationIconBadgeNumber = 2333;
    

    The corner mark of this Tabbar is like this:

    UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"建伟傻逼" image:nil tag:0];
    customItem1.badgeValue = @"2333"; 
    

    So the code is different.
    By the way, Cell, UILabel can be achieved by setting the background color to red and rounded corners

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 13:17:34

    What you said above is correct, add a UILabel
    Change the font color and background color
    Then change the corner in the layer
    That value should be half of your UILabel

    reply
    0
  • Cancelreply