Sunday, 15 September 2013

ios - Presenting a ViewController over another ViewController -


I have found a very long question today, because it explains something, starting with an example.


Example

Suppose I have three view controllers:

  1. Full Size Week Controller
  2. FirstViewController < Second view controller

Full size week controller, as the name states, is targeted to replace the entire screen. On the other hand, the first view controller and second view controller , Only about 3/4 of the height of the screen should be taken For example here are some pictures.

Full Size Week Controller

Here we have FullSizeViewController No, just two buttons - "first" & amp; "second". If you have not already captured it, then those two buttons should toggle each of the related view controllers, as shown below.

firstviewcontroller


problem

< P> Do I have main issues with this?

  1. Animate the controllers below
  2. Change the size of two small view controllers
  3. Still allow contact with FullSizeViewController Also a small view controller is open on top of its main content but does not have two toggle buttons?

what have I tried

Since I'm also not sure how to do this, I have not tried so much, but I got one thing Have tried.

In the IBAction, the "first" button is attached:

  Let's first: first Wii Controller = Self Storyboard. Instantiet UIU Controller with Identifier ("FirstviewConverter")! FirstViewController as self.PresentViewController (firstVC, animated: true, perfection: zero)  

FirstViewController in viewDidLoad:

  self.view.frame. Size = CGSizeMake (UIScreen.mainScreen (). Bounds.isize.width, UIScreen.mainScreen (). Bounds.size.height - 68)  

tl; Dr how can i get

Your full size vc should be the custom container view controller when you use one of the other controllers If you want to instantiate it, how to shape it, add it as a controller to see a child and to reduce the amount of animativity to the end of the screen where you want to end. You should not use the current ViewController because it can get you a model VC that leads you to the full screen. If you do not already have it, you should read the document called "Implementation of Custom Container View Controller".


No comments:

Post a Comment