简体   繁体   中英

changing view controller when the device orientation changes

Im making an ios app in xcode 4 and I need a way of changing what is displayed on the screen when the device orientation changes.

does anyone know how to do this?

thanks.

probably you need to check first how to detect if the device orientation changes see here: how to detect orientation change

then on the example on the link, you should know ho to change the view which is displayed on the screen. You can do it by using methods such as addSubview, presentModalViewController, pushViewController(for NavigationController) eg:

  • [self presentModalViewController:aView animated:YES];
  • [self addSubview:aView];
  • [self.navigationController pushViewController:aView animated:YES];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM