English 中文(简体)
UINavig 主计长认为
原标题:UINavigationController makes one view modaled

我在一开始有两页的载荷、日志和登记页。 登记册网页落后于标识页。

在原木页上,有一顿可上下游,因此,我需要导航控制器,以便可以在白页上“回落”纽吨。

因此,我把导航控制员安排在阿塞尔吉特

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];


    LoginViewController *_loginViewController = [[LoginViewController alloc] init];


    RegisterViewController *_registerViewController = [[RegisterViewController alloc] init];
    [self.window addSubview:_registerViewController.view];
    [_registerViewController release];

    [self.window addSubview:_loginViewController.view];


    navController = [[UINavigationController alloc] initWithRootViewController:_loginViewController];
    [self.window addSubview:self.navController.view];
    [_loginViewController release];
    [self.window makeKeyAndVisible];
    return YES;
}

这会使日志网页上的纽扣能够发挥良好作用,但是,如果走出日志和显示登记页,登记页不能回应用户的行动。

法典有什么错误?


EDIT:

我的坏话是明确的。 当我说“去掉”的标识时,它并不真正完全脱离。 仍然有五分之一的人在屏幕上。 然后登记页。 在该案中,我添加了标识页和登记页。 此外,我没有使用第十一B条。

@dasblinkenlight and @hiren443?

最佳回答

我认为,问题是,你在<条形码>上加上两个控制器的意见,并且错误地使用导航控制器。

你们应该做的是:

  • Create the navigation controller first
  • Push the registration page, and then the login page onto the controller
  • Hide the [back] button for the login page
  • Add navigation controller as the only subview of the main window

在日志页面控制器上,打电话的导航控制器popToRootViewController Animated以显示登记页。

问题回答

加入

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];


    LoginViewController *_loginViewController = [[LoginViewController alloc] init];
    navController = [[UINavigationController alloc] initWithRootViewController:_loginViewController];
    [self.window addSubview:self.navController.view];
    [_loginViewController release];
    [self.window makeKeyAndVisible];
    return YES;
}

缩略语

-(IBAction)DemoBtnPressed
{
  RegisterViewController *_registerViewController = [[RegisterViewController alloc] init];
  [self.navigationController pushViewController:_registerViewController animated:YES];

}

顺便提一下。 我的办法是:在试图将航标上上页(而不是外移,1/5被打上屏幕)显示登记页,而不是移动日志,而是移动日志。

但是,你们的评论确实有助于! 感谢!





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签