快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

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

在写内容过程中,把写内容过程中比较好的内容珍藏起来,下边内容内容是关于IOS系统中网络等待的Loading的实现方法的内容,希望能对码农有所帮助。

创新互联建站-专业网站定制、快速模板网站建设、高性价比隆回网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式隆回网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖隆回地区。费用合理售后完善,10余年实体公司更值得信赖。


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的实现方法的代码
网页URL:http://6mz.cn/article/psoiep.html

其他资讯