IOS系统中网络等待的Loading的实现方法的代码
2019-01-19 14:02
507 查看
在写内容过程中,把写内容过程中比较好的内容珍藏起来,下边内容内容是关于IOS系统中网络等待的Loading的实现方法的内容,希望能对码农有所帮助。
WebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 44, 320, 400)]; [WebView setUserInteractionEnabled:NO]; [WebView setBackgroundColor:[UIColor clearColor]]; [WebView setDelegate:self]; [WebView loadRequest:[NSURLRequest requestWithURL:url]]; [view setTag:103]; [view setBackgroundColor:[UIColor blackColor]]; [view setAlpha:0.8]; [self.view addSubview:view]; activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 32.0f, 32.0f)]; [activityIndicator setCenter:view.center]; [activityIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite]; [view addSubview:activityIndicator]; [self.view addSubview:WebView]; [view release]; [WebView release]; [activityIndicator startAnimating]; } [activityIndicator stopAnimating]; [view removeFromSuperview]; }
第二种方法:使用UIAlertViewandUIActivityIndicatorView
if (myAlert==nil){ myAlert = [[UIAlertView alloc] initWithTitle:nil message: @"读取中..." delegate: self cancelButtonTitle: nil otherButtonTitles: nil]; activityView.frame = CGRectMake(120.f, 48.0f, 38.0f, 38.0f); [myAlert addSubview:activityView]; [activityView startAnimating]; [myAlert show]; } } [myAlert dismissWithClickedButtonIndex:0 animated:YES]; }
相关文章推荐
- IOS系统中网络等待的Loading的实现方法 等待加载
- ios开发——代码实现获得手机系统的名字和版本号&当前网络状态
- ListView异步加载图片是非常实用的方法,凡是是要通过网络获取图片资源一般使用这种方法比较好,用户体验好,下面就说实现方法,先贴上主方法的代码:
- tcpdump_iOS系统网络抓包方法
- IOS CoreLocation实现系统自带定位的方法
- iOS系统网络抓包方法
- IOS中UIWebView加载Loading的实现方法
- iOS 利用运行时交换系统方法实现禁止同时点击两个按钮触发多个事件
- iOS系统网络抓包方法
- ios之让输入键盘隐藏消失的方法/以及系统通知的实现
- iOS系统网络抓包方法
- ios网络学习------3 用非代理方法实现异步post请求
- iOS 使用Moya网络请求的实现方法
- iOS实现获取系统iTunes音乐的方法示例
- iOS系统如何实现网络数据抓包
- iOS系统网络抓包方法
- IOS APP 国际化(实现不跟随系统语言,不用重启应用,代码切换stroyboard ,xib ,图片,其他资源)
- iOS系统网络抓包方法
- iOS - 网络数据加载等待页面的简单实现
- iOS系统网络抓包方法