最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

iOS UIAlertView自動(dòng)關(guān)閉功能

 更新時(shí)間:2017年06月20日 11:10:18   作者:弦外雨  
這篇文章主要介紹了iOS UIAlertView自動(dòng)關(guān)閉,需要的朋友可以參考下

一,效果圖。

二,代碼。

RootViewController.h
#import <UIKit/UIKit.h>
@interface RootViewController : UIViewController
<UIAlertViewDelegate>
@end
RootViewController.m
- (void)viewDidLoad
{
 [super viewDidLoad];
 // Do any additional setup after loading the view.
 //alert
 UIAlertView *alert=[[UIAlertView alloc]initWithTitle:nil message:@"一個(gè)可以自動(dòng)關(guān)閉的Alert窗口" delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
 [alert show];
 //顯示框
 UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
 indicator.backgroundColor=[UIColor redColor];
 indicator.center = CGPointMake(alert.bounds.size.width/2, alert.bounds.size.height-40.0);
 [indicator startAnimating];
 [alert insertSubview:indicator atIndex:0];
 //定時(shí)器
 [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(dismissAlert:) userInfo:[NSDictionary dictionaryWithObjectsAndKeys:alert, @"alert", @"testing ", @"key" ,nil] repeats:NO];
}
//alert 自動(dòng)消失
-(void) dismissAlert:(NSTimer *)timer{
 UIAlertView *alert = [[timer userInfo] objectForKey:@"alert"];
 [alert dismissWithClickedButtonIndex:0 animated:YES];
}

以上所述是小編給大家介紹的iOS UIAlertView自動(dòng)關(guān)閉,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

定州市| 霞浦县| 团风县| 娱乐| 通化市| 论坛| 惠水县| 诸暨市| 湘潭市| 山西省| 资兴市| 孝感市| 九台市| 安龙县| 蓬莱市| 新津县| 内黄县| 含山县| 肃南| 石嘴山市| 堆龙德庆县| 沙田区| 金昌市| 博湖县| 岑巩县| 都兰县| 鄄城县| 吉木萨尔县| 宁化县| 简阳市| 华阴市| 泾源县| 金阳县| 阜康市| 家居| 临漳县| 锡林郭勒盟| 塔河县| 永平县| 托克逊县| 上虞市|