Индикатор активности не показывает - PullRequest
1 голос
/ 05 ноября 2011

Возникла проблема, что мой индикатор активности не показывает никому идеи?

ViewController.h

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController 
{
    IBOutlet UIWebView *webview;
    IBOutlet UIActivityIndicatorView *active;
    UIAlertView *alert_start;   
}

ViewController.m

// Do any additional setup after loading the view, typically from a nib.
[webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"home-de" ofType:@"html"]isDirectory:NO]]];

- (void)webViewDidStartLoad:(UIWebView *) webview 
{  
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    [active startAnimating]; 
}

- (void)webViewDidFinishLoad:(UIWebView *) webview 
{ 
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    [active stopAnimating];
}

- (IBAction)tele_button:(id)sender
{
    //Local HTML Call Button
    NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"phone" ofType:@"html"]isDirectory:NO]];
    [self->webview loadRequest:theRequest];
}

- (IBAction)mail_button:(id)sender
{
    //Mail App Mail Button
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://info@optibelt.com"]];
}

- (IBAction)web_button:(id)sender
{
    //Local HTML Button
    NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString: @"http://optibelt.com"]];
    [self->webview loadRequest:theRequest];
}

- (IBAction)news_button:(id)sender
{
    //local Home Button
    NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"home-de" ofType:@"html"]isDirectory:NO]];
    [self->webview loadRequest:theRequest];
}

Активностьиндикатор настроен как анимация поведения (проверено) и скрывается при остановке (проверено)

Было бы здорово, если бы мне помогли :)

1 Ответ

1 голос
/ 05 ноября 2011

Возможно, вы захотите проверить пару вещей. Сначала проверьте, подключен ли выход индикатора активности в IB. Во-вторых, проверьте, находится ли индикатор активности над UIWebview. Может быть, это скрывается. Вы также можете проверить, что он не скрыт в IB.

Удачи

...