iphone - How to remove navigation bar from splash screen? -
i have problem in code create splash screen time interval. when execute on top of view navigation bar appeared. want hide navigation bar. how remove splash screen?
- (void)loadview { // init view //cgrect appframe = [[uiscreen mainscreen] applicationframe]; cgrect appframe = cgrectmake(0, 0, 320, 480); uiview *view = [[uiview alloc] initwithframe:appframe]; view.autoresizingmask = uiviewautoresizingflexibleheight|uiviewautoresizingflexiblewidth; self.view = view; [view release]; splashimageview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"ls.jpg"]]; splashimageview.frame = cgrectmake(0, 44, 320, 460); [self.view addsubview:splashimageview]; viewcontroller = [[menu alloc] init]; uinavigationcontroller *nc = [[uinavigationcontroller alloc] initwithrootviewcontroller:viewcontroller]; viewcontroller.view.alpha = 0.0; [self.view addsubview:nc.view]; timer = [nstimer scheduledtimerwithtimeinterval:2.0 target:self selector:@selector(fadescreen) userinfo:nil repeats:no];} -(void) ontimer{ nslog(@"load");
}
- (void)fadescreen{ [uiview beginanimations:nil context:nil]; // begins animation block [uiview setanimationduration:0.75]; // sets animation duration [uiview setanimationdelegate:self]; // sets delegate block [uiview setanimationdidstopselector:@selector(finishedfading)]; // calls finishedfading method when animation done (or done fading out) self.view.alpha = 0.0; // fades alpha channel of view "0.0" on animationduration of "0.75" seconds [uiview commitanimations]; // commits animation block. block done.
}
- (void) finishedfading{ [uiview beginanimations:nil context:nil]; // begins animation block [uiview setanimationduration:0.75]; // sets animation duration self.view.alpha = 1.0; // fades view 1.0 alpha on 0.75 seconds viewcontroller.view.alpha = 1.0; [uiview commitanimations]; // commits animation block. block done. [splashimageview removefromsuperview];
}
you can hide navigation bar self.navigationcontroller.navigationbar.hidden = yes;
the "default" splash screen:
using default.png image functionality of ios great alternative splash screens. add image named "default.png"('d' should uppercase) project , os take care of rest.
Comments
Post a Comment