Is it possible to push a view controller without n

2020-04-15 06:17发布

i've just started to write an application and i want to write it without navigation controller thereis going to be some viewController EX: aviewController , bviewController ...

Is it possible to push to b class's view controller (bviewController) from aViewController wiyhout using navigation controller ?

With otherwords ,

are there any different option for this code :

[self.navigationController pushViewController:self.bViewController animated:YES]; ???

3条回答
▲ chillily
2楼-- · 2020-04-15 06:58

You display a Modal view:

 [self presentModalViewController:someViewController animated:YES];

The transition animation is set on the viewcontroller that you are going to display.

As @deanWombourne stated below, why don't you wan't to use the Navigation controller? If you are pushing viewcontrollers then the navigation controller is the way to go.

If you don't want the navigationbar you can just hide it and pop the view controller your self:

// Remove the current visible view controller:
[self.navigationController popViewControllerAnimated:YES];
查看更多
ら.Afraid
3楼-- · 2020-04-15 07:04

Are you looking for this maybe?

    [self.bViewController.navigationController setNavigationBarHidden:YES animated:YES];
查看更多
干净又极端
4楼-- · 2020-04-15 07:07

You could use a UINavigationController and push it, and hide the navigationbar.

查看更多
登录 后发表回答