Jump between IOS pages and between ios pages
There are two commonly used methods: navigation and direct jump.
The first method of direct jump is to create a new target page, and then set the page Jump animation to initialize the data on the target page:
ValueInputView * valueView = [[ValueInputView alloc] initWithNibName: @ "ValueInputView" bundle: [NSBundle mainBundle];
ValueView. delegate = self;
[ValueView setModalTransitionStyle: UIModalTransitionStyleCoverVertical];
[Self presentModalViewController: valueView animated: YES];
// Return
[Self dismissModalViewControllerAnimated: YES];
Second:
The UINavigationController is used to call pushViewController for redirection. In this way, the Controller is managed by means of stack pressure and stack exit. You can call the popViewControllerAnimated method to return
PickImageViewController * ickImageViewController = [[PickImageViewController alloc] init];
[Self. navigationController pushViewController: ickImageViewController animated: true];
Four setModalTransitionStyle
UIModalTransitionStyleCoverVertical slide from the bottom into UIModalTransitionStyleFlipHorizontal, flip horizontally into UIModalTransitionStyleCrossDissolve, cross-Dissolve UIModalTransitionStylePartialCurl, flip
Scenario Switching
There are a total of five styles to switch between multiple scenarios:
Modal (mode) -- transition to another scenario to complete a task. After the task is completed, the scenario is closed and returned to the original scenario.
Push (press-in)-creates a scenario chain where you can move it before and after. Used for navigation view controllers.
Replace (Replace, applicable only to iPad) -- Replace the current scenario for some view controllers specific to the iPad.
Popover (pop-up box for iPad only)-a pop-up box with arrows.
Custome (custom)-perform custom transition between scenarios by compiling.
Transition is an animation played when switching from one scene to another. There are four options:
Cover Vertical-the new scenario moves from bottom to top, gradually covering the old scenario.
Flip Horizontal-views are flipped horizontally to show new scenes on the back.
Cross Dissolve-old scenarios fade out and new scenarios Fade in.
Partial Curl-the old scenario is opened like a book page, showing the new scenario below.
In the iPad application, there will be an extra Presentation attribute, which determines the display mode of the modal view on the screen. There are four display styles:
Form Sheet-adjust the scene to be smaller than the screen (regardless of orientation) and display the original scene after the current scene, which is almost equivalent to displaying it in an iPad window.
Page Sheet-adjust the scene size to display it in vertical format.
Full Screen-adjust the scene size to overwrite the entire Screen.
Current Context: displays a scenario in the original scenario.
Jump between two xib pages in ios
Are you done? I'm also thinking about this.
Ios development: How to click a button to jump to a new interface ,~~~
1. You can use the navigation controller stack. Use the current view controller as the rootViewController. You need to create it in the code that creates the current controller.
UIViewController * vc1 = [[UIViewControlelr alloc] init];
UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController: vc1];
[Vc1 release];
[Window addSubView: navController. view];
[NavController release];
PushViewController can be used to navigate other views only when the current controller is in the navigation controller stack.
Navigate to the New View Controller:
UIViewController * vc2 = [[ViewController alloc] init];
[Self. navigationController pushViewController: vc2 animated: YES];
[Vc2 release];
2. Modal View
UIViewController * vc2 = [[ViewController alloc] init];
[Self presentModalViewController: controller animated: YES];
[Vc2 release];
3. overwrite the current view with the new view
If this method is used, we recommend that you create a controller swithController that can maintain the interaction between controllers. In this controller, You can implement view switching between different controllers.
@ Inertface SwitchViewController: UIViewController
@ Property (retain) UIViewController * vc1
@ Property (retain) UIViewController * vc2;
-(Void) showVC1;
-(Void) showVC2;
@ End
@ Implementation SwitchViewController
@ Synthesize vc1, vc2;
-(Void) showVC1 {
If (vc2 ){
[Vc2.view removeFromSuperView];
}
[Self. view addSubView: vc1.view];
}
@ End