我要顯示我的活動的指標,直到整個網頁是loaded.Please幫我出了一些示例程序或blogs.Thanks活動的指標被加載
webView = [[UIWebView alloc] initWithFrame:webFrame];
webView.backgroundColor = [UIColor greenColor];
[second.view addSubview:webView];
webView.backgroundColor = [UIColor grayColor];
webView.scalesPageToFit=YES;
[webView release];
NSString *urlAddress = storyLink;
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[(UIActivityIndicatorView *)[self navigationItem].rightBarButtonItem.customView startAnimating];
我已經使用上面的代碼
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {}
方法。
我創建活動指示燈在下面的方法
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[super viewWillAppear:YES];
UIActivityIndicatorView * activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithCustomView:activityIndicator];
[self navigationItem].rightBarButtonItem = barButton;
}
對我來說,活動idicator是創建和銷燬內3個seconds.I希望它顯示,直到網頁完全loaded.Please幫助我。謝謝。
請檢查我是否編輯過我的密碼 – Warrior 2010-01-20 14:30:41