V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
xuming
V2EX  ›  iDev

很多应用,比如微信,在 UITabBarItem 右上角有一个小红点,注意(不是带数字的小红圈),这个有什么简便的实现方式不

  •  
  •   xuming · 2014-07-12 17:08:02 +08:00 · 12711 次点击
    这是一个创建于 3569 天前的主题,其中的信息可能已经有所发展或是发生改变。
    就是一个小圆点
    9 条回复    2014-07-16 10:58:47 +08:00
    xuan_lengyue
        1
    xuan_lengyue  
       2014-07-12 20:18:53 +08:00
    给 TabBar 加 subview 即可,很简单。
    fangzhzh
        2
    fangzhzh  
       2014-07-12 20:36:00 +08:00
    加个imageiew?
    hoogle
        3
    hoogle  
       2014-07-12 20:56:35 +08:00 via iPhone
    badge = @""
    hoogle
        4
    hoogle  
       2014-07-12 20:59:34 +08:00 via iPhone
    自定义大小、形状、颜色的话可以考虑AddSubview到bar或者生成一个带点的barItem image
    xuming
        5
    xuming  
    OP
       2014-07-13 08:11:50 +08:00 via iPhone
    badge 生成的太大,生成带点的图片不通用,看来AddSubview比较可行
    79bxh9b
        6
    79bxh9b  
       2014-07-13 23:12:39 +08:00
    UITabBarItem不属于uiview吧,能加subview?
    dopcn
        7
    dopcn  
       2014-07-15 16:00:36 +08:00
    UITabBarItem 在 UITabBar 上,加在 bar 上吧
    skingtree
        8
    skingtree  
       2014-07-16 10:56:12 +08:00
    badgeValue
    Text that is displayed in the upper-right corner of the item with a surrounding red oval.

    @property(nonatomic, copy) NSString *badgeValue

    -- UITabBarItem
    skingtree
        9
    skingtree  
       2014-07-16 10:58:47 +08:00
    要不自己加个uiview,setBackgroundColor,再设置一下layer.cornerRadius
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2281 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 00:53 · PVG 08:53 · LAX 17:53 · JFK 20:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.