我想添加活動指示器&顯示當我選擇didSelectRowAtIndexPath並隱藏在顯示詳細信息頁面時... plz幫助任何人....並給出任何示例代碼。活動指示器顯示並隱藏在splash圖片和UITableView
0
A
回答
1
-(void)showActivityViewer {
self.activityView = [[[UIView alloc] initWithFrame: CGRectMake(0, 0, self.view.window.bounds.size.width, self.view.window.bounds.size.height)] autorelease];
activityView.backgroundColor = [UIColor blackColor];
activityView.alpha = 0.5;
self.activityWheel = [[[UIActivityIndicatorView alloc] initWithFrame: CGRectMake(self.view.window.bounds.size.width/2 - 12, self.view.window.bounds.size.height/2 - 12, 24, 24)] autorelease];
activityWheel.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
activityWheel.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin);
[activityView addSubview:activityWheel];
[self.view.window addSubview: activityView];
[[[activityView subviews] objectAtIndex:0] startAnimating];
}
-(void)removeActivityViewer {
[activityWheel removeFromSuperview];
[activityView removeFromSuperview];
self.activityWheel = nil;
self.activityView = nil;
}
+0
Thanx朋友... – 2011-05-11 09:38:44
0
MBProgressHUD就是這麼做的!退房https://github.com/jdg/MBProgressHUD
可以請你詳細說明你的情況。你的問題標題不符合你的問題 – Swastik 2011-05-11 07:55:22