IOS系统中网络等待的Loading的实现方法的代码

发布时间:2020-09-20 18:10:21 作者:App_in
来源:网络 阅读:622

在写内容过程中,把写内容过程中比较好的内容珍藏起来,下边内容内容是关于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];
}
推荐阅读:
  1. linux c 关于进程等待的代码
  2. selenium中WebDriverWait类等待机制的实现方法

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

网络等待 ios %d

上一篇:如何在Spring boot加入shiro支持

下一篇:React组件内事件传参实现tab切换的示例代码

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》