웹 페이지가로드되는 동안 ATM HUD를 사용하는 UIWebView가 있습니다. HUD가 작동하기 시작하도록 할 수는 있지만 웹 페이지가로드 된 후에도 HUD가 계속 작동합니다. 한 번로드 한 HUD가 회전을 멈추게하는 방법을 찾아야합니다. 아래 코드는 지금까지 가지고있는 코드입니다.IOS 프로젝트 용 UIWebView에서 HUD를 숨길 수 없습니다
@implementation ThenewsViewController
@synthesize hud;
- (void)showHud {
// Show hud with activity indicator
NSLog(@"hud: %@", hud);
if (!hud) {
hud = [[ATMHud alloc] initWithDelegate:self];
[self.navigationController.view addSubview:hud.view];
[hud setCaption:@"Loading news..."];
[hud setActivity:YES];
[hud update];
if (![hud isBeingPresented])
[hud show];
} else {
NSLog(@"hud exists... resetting.");
hud = nil;
[self showHud];
}
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSURL *myURL = [NSURL URLWithString:@"http://www.hiphopdx.com/m/index.php?s=news"];
NSURLRequest *myRequest = [NSURLRequest requestWithURL:myURL];
[myWebView loadRequest:myRequest];
UIColor *navBarColor = UIColorFromRGB(0x089932);
[[self.navigationController navigationBar] setTintColor:navBarColor];
if (![hud isBeingPresented])
[self showHud];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidFinishLoad:(UIWebView *)webView
{
NSLog(@"Done loading web view");
[hud hide];
}
@end
이 코드는 어디에 넣으시겠습니까? –