ios - How can i add UIViewController after splash screen in phonegap project? -
i have created 1 phonegap ios project.in after splash screen loading index.html file. add 1 introduction viewcontroller below image after splash screen , user have option close introduction viewcontroller can see index.html file.
is there anyway add uiviewcontroller file before loading index.html ??
eg: splash screen --> introduction viewcontroller --> index.html
go classes >> appdelegate.m file replace didfinishlaunchingwithoptions function code
- (bool)application:(uiapplication*)application didfinishlaunchingwithoptions:(nsdictionary*)launchoptions { cgrect screenbounds = [[uiscreen mainscreen] bounds]; self.window = [[[uiwindow alloc] initwithframe:screenbounds] autorelease]; self.window.autoresizessubviews = yes; self.viewcontroller = [[[mainviewcontroller alloc] init] autorelease]; self.viewcontroller.usesplashscreen = yes; uiviewcontroller *mycontroller = [[uiviewcontroller alloc] init]; uiview *myview = [[uiview alloc] initwithframe:self.viewcontroller.view.frame]; myview.backgroundcolor = [uicolor whitecolor]; mycontroller.view = myview; uinavigationcontroller *mynav = [[uinavigationcontroller alloc] initwithrootviewcontroller:mycontroller]; uibarbuttonitem *leftbutton = [[uibarbuttonitem alloc] initwithtitle:@"cancel" style:uibarbuttonitemstyledone target:self action:@selector(cancel)]; mycontroller.navigationitem.leftbarbuttonitem = leftbutton; self.window.rootviewcontroller = mynav; [self.window makekeyandvisible]; return yes; } -(void)cancel{ self.window.rootviewcontroller = self.viewcontroller; [self.window makekeyandvisible]; }
Comments
Post a Comment