开发者

How to hide a UITabBarController until the first time webViewdidFinishLoad on the first view is called

I have a Tab Bar Controller-based app which has four views. I have a Splash screen I load in my AppDelegate which after a period of time shows the Tab Bar as follows:

开发者_JAVA技巧// Show tab bar [window addSubview:tabBarController.view];

What I would like to do is keep the Splash screen visible and in my first view that is loaded show the tabBarController only after my webViewDidFinishLoad delegate in FirstViewController.m is executed the first time.

Is there any way to do this? I am just learning how to do this and so far I seem to be having no luck with any of the code I have tried to achieve this. I still don't know how to hide and show the UITabBarController however.

EDIT: I found this code which is useful as a barrier for the code I need to show the parent UITabBarController:

  • (void)webViewDidFinishLoad:(UIWebView *)webView { // finished loading, hide the activity indicator in the status bar [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;

    // Still loading? if (web.loading) return; }


Make a object of your splash screen by using Nib and add this on window

[window addSubView:obj]; [self performSelector:@selector(loadFirstViewOnDelay) withObject:nil afterDelay:0.5];

in DidFinishLaunching

then

-(void)loadFirstViewOnDelay {

[window addSubview:tabBarController.view]; }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜