在寫內(nèi)容過程中,把寫內(nèi)容過程中比較好的內(nèi)容珍藏起來,下邊內(nèi)容內(nèi)容是關(guān)于IOS系統(tǒng)中網(wǎng)絡(luò)等待的Loading的實(shí)現(xiàn)方法的內(nèi)容,希望能對碼農(nóng)有所幫助。
創(chuàng)新互聯(lián)建站-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比隆回網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式隆回網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋隆回地區(qū)。費(fèi)用合理售后完善,10余年實(shí)體公司更值得信賴。
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];
}