iphone之数据加载界面

来源:互联网 发布:erdai cms 编辑:程序博客网 时间:2024/06/09 23:36

from:http://blog.sina.com.cn/s/blog_4adf31ea0100qvp1.html

iphone之数据加载界面1

代码如下:

-(void) action: (UIBarButtonItem *) item

{

 

loadingview = [[UIAlertView alloc] initWithTitle:nil 

   message@"请稍候... ..."

   delegateself

  cancelButtonTitle: nil

  otherButtonTitles: nil];

//创建等待图标

UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];

activityView.frame = CGRectMake(120.f48.0f37.0f37.0f);

[loadingview addSubview:activityView];

[activityView startAnimating];

[activityView release];

[loadingview show];

 

[NSThread detachNewThreadSelector:@selector(CloseLoading) toTarget:selfwithObject:nil];

 


}


-(void) CloseLoading

{

//等待3

[NSThread sleepForTimeInterval:3];

 

//删除等待视图

[loadingview dismissWithClickedButtonIndex:0 animated:YES];

}


原创粉丝点击