开发者

How can i navigate forward and backward with out navigation controller

开发者 https://www.devze.com 2023-02-20 06:03 出处:网络
i am using UIViewcontroller in my application and i want to navigate forward when click 开发者_Go百科on the button, and in 2nd view when i click back, the view is navigate back like navigation control

i am using UIViewcontroller in my application and i want to navigate forward when click 开发者_Go百科on the button, and in 2nd view when i click back, the view is navigate back like navigation controller.How can i do this?I am not using navigation controller and i can't.Thanks


You can add the second view as a subview of first one (with same size), to come back in to first view use the function removeFromSuperView from second view.


use the following code With navigation controller push the controller

        DetailView *detailObj = [[DetailView alloc] initWithNibName:@"DetailView_Phone" bundle:[NSBundle mainBundle]];

[self.navigationController pushViewController:detailObj animated:YES];

pop the controller

[self.navigationController popViewControllerAnimated:YES];

check out the link for help without navigation controller.

if you have a problem with navigation bar u can hide it also.

[self presentModalViewController:anotherViewController animated:YES];

using this u can move one view to another view

Regards,

Shyam

0

精彩评论

暂无评论...
验证码 换一张
取 消