您好,登錄后才能下訂單哦!
在寫內(nèi)容過(guò)程中,把寫內(nèi)容過(guò)程中比較好的內(nèi)容珍藏起來(lái),下邊內(nèi)容內(nèi)容是關(guān)于IOS系統(tǒng)中網(wǎng)絡(luò)等待的Loading的實(shí)現(xiàn)方法的內(nèi)容,希望能對(duì)碼農(nóng)有所幫助。
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];
}
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。