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
chenluois
V2EX  ›  iDev

像 Xcode 那种 “Build Succeeded” 提示怎么实现呢?

  •  
  •   chenluois · 2012-07-20 20:15:53 +08:00 · 4468 次点击
    这是一个创建于 4297 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如图:


    提示出现几秒后能够自动消失,这个怎么实现呢?
    8 条回复    1970-01-01 08:00:00 +08:00
    xatest
        2
    xatest  
       2012-07-20 20:59:06 +08:00   ❤️ 1
    这种View叫做HUD(Heads Up Display),一般用于显示当前状态。
    https://github.com/samvermette/SVProgressHUD
    https://github.com/jdg/MBProgressHUD
    chenluois
        3
    chenluois  
    OP
       2012-07-20 21:03:01 +08:00
    @Kymair 这个光有个形,怎么让它比如出现 2 秒后自动消失呢?
    @xatest 这两个都是 iOS 的啊,有 Mac 上的例子吗?

    谢谢!
    elden
        4
    elden  
       2012-07-20 21:07:14 +08:00   ❤️ 1
    @chenluois [self retain]; 两秒后再release
    chenluois
        6
    chenluois  
    OP
       2012-07-20 22:12:05 +08:00
    谢谢各位!自动消失用 NSTimer 实现了。
    BenX
        7
    BenX  
       2012-07-21 00:16:32 +08:00
    - (void)hideViewAnimated:(BOOL)animated {
    [self.timer invalidate];

    if (animated) {
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(hideViewDidStop:finished:context:)];

    self.alpha = 0.0;

    [UIView commitAnimations];
    } else {
    self.alpha = 0.0f;
    self.hidden = YES;

    [self removeFromSuperview];
    }
    }
    dingtianran
        8
    dingtianran  
       2012-07-21 23:46:32 +08:00
    Xcode这个提示是好像是来自notification center,似乎不是自己实现的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1507 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:58 · PVG 07:58 · LAX 16:58 · JFK 19:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.