View switch

 1 view switch

The first mode of the mode switching transitions

According to legend, the anti-type modalTransitionStyle value of the first view add it when UIModalTransitionStylePartialCurl, will return directly to the first view of the second view in TouchBegan ... TextField method is clicked dissmiss, TextField can not be edited

modalPresentationStyle

Need to instantiate a rear view of the root view controller arranged to control navigation controller, and then switching,

NextUIViewController * v = [[NextUIViewController alloc] init];

UINavigationController *navVC =[[UINavigationController alloc]initWithRootViewController:vc];

[self presentViewController:navVC animated:YES completion:NULL];

if([self.delegate respondsToSelector:@selector(reverseSendValue:)]){

//        [self.delegate reverseSendValue:tf.text];

        [self.delegate performSelector:NSSelectorFromString(@"reverseSendValue:")withObject:tf.text];

    }

Two kinds of transitions:

UINavigationController, navigationBar / toolBar  , UIBarButtonItem

Each view has its own controller navigationitem attributes, each view navigationitem controller is different, which may be provided by the back button navigationbar, left and right view, the titleView attributes

Height 44, tabbar height 49

// set the Back button, the next screen reflects

    self.navigationItem.backBarButtonItem = backItem;

pushViewController:  animated:

popToViewController:self.navigationController.viewControllers[0]

Direct switching view 3

UIWindow object through the window to get property of UIView

Reassign UIWindow object rootViewController property

4 by switching view manage subview

  Made with a view controller container, the other view controller view controller added to the vessel, then the first view to be presented view controller attached to the container View Controller ([self.view addSubiew: self .childViewControllers [0]]). When the need to toggle between views, the view controller can call the container transitionFromViewController: toViewController: duration: options: animations: completion methods; if removed from the container view controller removeFromParentViewController current view controller may invoke methods.

The rotation of the view controller

May be provided in the common setting items (General) option "Device Orientation" check device allows rotational direction, as shown; may be provided "Supported interface orientations" info.plist file key, value may be used include: Portrait (bottom home button), Landscape (left home button), Landscape (right home button), Portrait (top home button)

6 custom switching effect

https://www.cnblogs.com/zanglitao/p/4167909.html

https://www.jianshu.com/p/ad492060b741

Reproduced in: https: //www.jianshu.com/p/9b044902ba4b

Guess you like

Origin blog.csdn.net/weixin_34026484/article/details/91111045