zoukankan      html  css  js  c++  java
  • 定时消失的Alert弹窗

    在公共类里面写如下两个类方法就可以了,只需要把第一个类方法公布出来:

    代码如下:

    #pragma mark --- 定时弹窗 ---
    + (void)showAlertViewWithTitle:(NSString *)title message:(NSString *)message afterDelay:(NSTimeInterval)delay {
        
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
        [alert show];
        [self performSelector:@selector(dimissAlert:) withObject:alert afterDelay:delay];
    }
    
    + (void)dimissAlert:(UIAlertView *)alert {
        if(alert)     {
            [alert dismissWithClickedButtonIndex:[alert cancelButtonIndex] animated:YES];
        }
    }
    

      

  • 相关阅读:
    CSU 1122
    CSU 1256
    CSU 1240
    HDU 1874
    CSU 1004
    Problem F CodeForces 16E
    Problem E CodeForces 237C
    Problem C FZU 1901
    12-30
    2016-12-29
  • 原文地址:https://www.cnblogs.com/Walking-Jin/p/7485726.html
Copyright © 2011-2022 走看看