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 7565965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:17:31+00:00 2026-05-30T14:17:31+00:00

I wrote a basic two-view application that switches from one view to another every

  • 0

I wrote a basic two-view application that switches from one view to another every time I press a button.

But for some reason when I run it on simulator, both views are always few pixels above the MainWindow.xib view, always being on top of it. And what’s strange is that there is no animation when I switch between Views.

What is the problem???

This is what I have in my AppDelegate.m

-(void)switchView:(UIView *)view1 toView:(UIView *)view2{

    [UIView beginAnimations:@"Animation" context:nil];
    [UIView setAnimationDuration:1.75];
    [UIView setAnimationTransition:UIViewAnimationOptionTransitionFlipFromLeft forView:self.window cache:YES];
    [view1 removeFromSuperview];
    [window addSubview:view2];
    [UIView commitAnimations];
}
  • 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-05-30T14:17:33+00:00Added an answer on May 30, 2026 at 2:17 pm

    Hi Try This,

     -(void)switchView:(UIView *)view1 toView:(UIView *)view2
        {
            view2.frame = self.window.bounds;
            [UIView beginAnimations:nil context:NULL];
            [UIView setAnimationDelegate:self];
            [UIView setAnimationDuration:0.5f];
            [UIView setAnimationBeginsFromCurrentState:YES];
            [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:view2 cache:NO];
            [view1 removeFromSuperview];
            [window addSubview:view2];
            [UIView commitAnimations];
        }
    

    Also try this

    [UIView transitionWithView:view2 duration:0.5
            options:UIViewAnimationTransitionFlipFromLeft //change to whatever animation you like
            animations:^ { [window addSubview:view2]; }
            completion:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently wrote an extremely basic edge detection algorithm that works on an array
I have two basic Cpp tasks, but still I have problems with them. First
I have created a) a basic application MVVMLight framework. b) another project in the
I wrote an application that is using beans for creating and storing books(titles,authors etc)
I wrote a basic UNIX program that uses some low-level I/O. Nothing special, here's
I need some help with using integer from one activity to another. I am
I wrote a basic Hippity Hop program in C, Python, and OCaml. Granted, this
I wanted to write something basic in assembly under Windows. I'm using NASM, but
I know how to write the basic c# code to send emails, but I'm
I am using C to write a DLL that provides basic database connection functionality

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.