在UIWebView加载之前显示标签

时间:2013-07-12 02:07:49

标签: objective-c cocoa-touch uiwebview uitabbar

当我的应用启动时,用户首先看到的是UITabBar中的网络视图。不幸的是,在网页加载之前,他们会盯着空白的白色屏幕减去UITabBar。网页加载后如何隐藏标签?

firstviewcontroller.h:

@property (strong, nonatomic) IBOutlet UIWebView *webPage;

firstviewcontroller.m:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSString *fullURL = @"http://example.com";
    NSURL *url = [NSURL URLWithString:fullURL];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [_webPage loadRequest:requestObj];
}

1 个答案:

答案 0 :(得分:2)

看一下UIWebView委托方法webViewDidFinishLoad:。这将在页面加载后调用,然后您可以从其超级视图中删除标签或将其隐藏属性设置为YES。