感謝您花時間回答我!如何用Xcode(xib)中的後退按鈕創建「UINavigationController」?
我在IOS開發方面經驗不足,經過幾次谷歌搜索後,我轉向你。
我的問題是:我會希望使用UINavigationController,新的主視圖,讓我創建一個後退按鈕。
這裏是我的AppDelegate.m:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
MainViewController *mvc = [[MainViewController alloc]init];
//self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
//UINavigationController * navController = [[UINavigationController alloc]initWithRootViewController:self.viewController];
self.window.rootViewController = mvc;
[self.window makeKeyAndVisible];
return YES;
}
和我AppDelegate.h:
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
//@property (strong, nonatomic) ViewController *viewController;
@end
在發展過程中,我改變,你可以看到上面的兩行註釋的應用程序的主視圖出。
我想在這個新的主視圖中使用「UINavigationController」,它會發生什麼變化?和哪裏?
謝謝,抱歉,如果我不清楚! (Google Translate)
你試過設置MainViewController從UINavigationController繼承嗎? –