試試這個代碼。
AppDelegate.h
#import <UIKit/UIKit.h>
#import "LoginViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong,nonatomic) UINavigationController *navigationController;
@property (strong,nonatomic) LoginViewController *loginVC;
@end
AppDelegate.m
#import "AppDelegate.h"
#import "LoginViewController.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.loginVC = [[LoginViewController alloc]initWithNibName:nil bundle:nil];
self.loginVC.title = @"Login Page";
self.navigationController = [[UINavigationController alloc]initWithRootViewController:self.loginVC];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
}
LoginViewController.h
#import <UIKit/UIKit.h>
#import "MyProfileViewController.h"
@interface LoginViewController : UIViewController
@property (strong,nonatomic)MyProfileViewController *myProfileVC;
@end
在LoginViewController登錄按鈕操作。M檔
- (IBAction)pushMyProfileView:(id)sender
{
self.myProfileVC = [[MyProfileViewController alloc]initWithNibName:nil bundle:nil];
[self.navigationController pushViewController:self.myProfileVC animated:YES];
}
看看的UITabBarController,除了登錄可能 – Christian 2015-03-02 07:17:57
是的,但隨後的標籤欄在底部顯示的是有用的,正確的? – user2490003 2015-03-02 07:32:49
是的,這是賴特 – Christian 2015-03-02 07:35:59