去上課>> AppDelegate.m文件與此代碼
- (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];
}
來源
2014-02-06 07:20:18
Ved
更換didFinishLaunchingWithOptions功能你請告訴我如果我加了這個會發生什麼? – Bangalore
根據SPLASH SCREEN - > INTRODUCTION VIEWCONTROLLER - > INDEX.html在啓動畫面加載這個自定義viewcontroller後有左邊的取消按鈕,你用加載index.html文件 – Ved
它的工作很棒後用這個按鈕做動作.. – Bangalore