去上课>> 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