Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:10:12+00:00 2026-06-02T17:10:12+00:00

I am trying to get the new IOS 5 Container viewControllers working properly but

  • 0

I am trying to get the new IOS 5 Container viewControllers working properly but I am having an issue animating between them.

I have a “rootViewController”. In this controller, I have added 2 child view controllers. This functions almost like a splitViewController. On the left I have a VC that handles navigation, and on the right I have a VC that shows specific content.

I am trying to animate between the VC on the right, and a new VC which will replace it.

This is my code for the animation:

public void Animate(UIViewController toController) {
    AddChildViewController(toController);
    activeRightController.WillMoveToParentViewController(null);
    toController.View.Frame = activeRightController.View.Frame;
    Transition(activeRightController, toController, 1.0, UIViewAnimationOptions.TransitionCurlUp, () => {},
        (finished) => {
        activeRightController.RemoveFromParentViewController();
        toController.DidMoveToParentViewController(this);
        activeRightController = toController;
    });
    activeRightController = toController;
}

Almost everything works, it transitions to my new view using the CurlUp transition, however the transition itself goes across the WHOLE screen…not just the single view that I want to transition. Its “curling Up” the parent view, and not the child. It does however replace only the child view underneath it. I hope this makes sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:10:14+00:00Added an answer on June 2, 2026 at 5:10 pm

    I created a new UIViewController class that is a thin container for the right side controllers and handles the swap animation. See the sample below.

    using System;
    using MonoTouch.Foundation;
    using MonoTouch.UIKit;
    using System.Drawing;
    
    namespace delete20120425
    {
        [Register ("AppDelegate")]
        public partial class AppDelegate : UIApplicationDelegate
        {
            UIWindow window;
            MainViewController mvc;
    
            public override bool FinishedLaunching (UIApplication app, NSDictionary options)
            {
                window = new UIWindow (UIScreen.MainScreen.Bounds);
    
                mvc = new MainViewController ();
    
                window.RootViewController = mvc;
                window.MakeKeyAndVisible ();
    
                return true;
            }
        }
    
        public class MainViewController : UIViewController
        {
            SubViewController vc1;
            ContainerViewController vc2;
    
            public override void ViewDidLoad ()
            {
                base.ViewDidLoad ();
    
                vc1 = new SubViewController (UIColor.Blue);
                this.AddChildViewController (vc1);
                this.View.AddSubview (vc1.View);
    
                UIButton btn = UIButton.FromType (UIButtonType.RoundedRect);
                btn.Frame = new RectangleF (20, 20, 80, 25);
                btn.SetTitle ("Click", UIControlState.Normal);
                vc1.View.AddSubview (btn);
    
                SubViewController tmpvc = new SubViewController (UIColor.Yellow);
                vc2 = new ContainerViewController (tmpvc);
    
                this.AddChildViewController (vc2);
                this.View.AddSubview (vc2.View);
    
                btn.TouchUpInside += HandleBtnTouchUpInside;
            }
    
            void HandleBtnTouchUpInside (object sender, EventArgs e)
            {
                SubViewController toController = new SubViewController (UIColor.Green);
                vc2.SwapViewController (toController);
            }
    
            public override void ViewWillLayoutSubviews ()
            {
                base.ViewDidLayoutSubviews ();
    
                RectangleF lRect = this.View.Bounds;
                RectangleF rRect = lRect;
    
                lRect.X = lRect.Y = lRect.Y = 0;
    
                lRect.Width = .3f * lRect.Width;
                rRect.X = lRect.Width + 1;
                rRect.Width = (.7f * rRect.Width)-1;
    
                this.View.Subviews[0].Frame = lRect;
                this.View.Subviews[1].Frame = rRect;
            }
    
            public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
            {
                return true;
            }
        }
    
        public class ContainerViewController : UIViewController
        {
            UIViewController _ctrl; 
            public ContainerViewController (UIViewController ctrl)
            {
                _ctrl = ctrl;   
            }
    
            public override void ViewDidLoad ()
            {
                base.ViewDidLoad ();
    
                AddChildViewController (_ctrl);
                View.AddSubview (_ctrl.View);
            }
    
            public void SwapViewController (UIViewController toController)
            {
                UIViewController activeRightController = _ctrl;
    
                AddChildViewController(toController);
                activeRightController.WillMoveToParentViewController(null);
                toController.View.Frame = activeRightController.View.Frame;
                Transition(activeRightController, toController, 1.0, UIViewAnimationOptions.TransitionCurlUp, () => {},
                    (finished) => {
                    activeRightController.RemoveFromParentViewController();
                    toController.DidMoveToParentViewController(this);
                    activeRightController = toController;
                });
                activeRightController = toController;   
            }
    
            public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
            {
                return true;
            }
    
            public override void ViewWillLayoutSubviews ()
            {
                base.ViewWillLayoutSubviews ();
                RectangleF tmp = this.View.Frame;
                tmp.X = tmp.Y = 0;
                _ctrl.View.Frame = tmp;
            }
        } 
    
        public class SubViewController : UIViewController
        {
            UIColor _back;
            public SubViewController (UIColor back)
            {
                _back = back;
            }
    
            public override void ViewDidLoad ()
            {
                base.ViewDidLoad ();
                this.View.BackgroundColor = _back;
            }
    
            public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
            {
                return true;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: I have made a clean, new project, but still can't get it working.
I'm new to PHP and trying to get my head around security. I have
I'm new to the mac and trying to get gcc 4.6 working. I installed
I'm new to IOS development, and I'm just trying to get my head around
Hi All I'm new to iOS development and am currently having an issue with
I'm using the official FBConnect library for iOS and trying to get it working
Im new to iOS programming and I'm trying to get the table view running
I´m new to PhoneGap/CoffeeScript trying to get a Hello World App running in iOS
I'm new in internet connection for iOS. I'm trying to get data from special
I'm trying to get a new Enterprise Application Project set up in Eclipse using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.