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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:40:17+00:00 2026-05-25T18:40:17+00:00

I am creating a view and having it move on to the screen from

  • 0

I am creating a view and having it move on to the screen from left to right. I had a hard time getting it to work the way I wanted but when I did I was baffled at the way it worked.

I thought I would have to create the view off screen to the left then use CGAffineTransformTranslate to move it onto the screen. But instead I am creating it on the screen, but it still works great. I am a bit confused.

Here I am creating the view…

profileViewControllerForIPad = [[ProfileViewController alloc] initWithFrame:CGRectMake(0, 0, 512, 446)];

As you can see the origin is 0,0. So on screen, right?

Here is the thransform…

[UIView animateWithDuration:0.5 
         animations:^{
            self.view.transform = CGAffineTransformTranslate(CGAffineTransformIdentity,self.view.frame.size.width, 0.0);                             
         }
 ];

As you can see I am setting the tx value to the width of the CGAffineTransformTranslate which I thought was the value for the number of pixels you wanted it to move from it’s current position, origin.x of 0, which I expected would move it to the middle of the screen somewhere. Instead, it slides right in with it’s new origin.x right at 0 where I want it.

BTW CGAffineTransformIdentity works great sliding the view right back off the screen.

Can someone explain this to me. The docs seem to say something different.

Thanks,

John

  • 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-25T18:40:17+00:00Added an answer on May 25, 2026 at 6:40 pm

    I think I understand it now. I think it depends on when you execute CGAffineTransformTranslate.

    If you are creating the object and call CGAffineTransformTranslate before you add it to it’s superview, when you add it to it’s superview it will display at a position that will allow it to move to it’s defined position the amount and direction defined in the CGAffineTransformTranslate call.

    If on the other hand the object you want to move is already being displayed, the object will be moved from it’s current position to the new position.

    In my case where I was creating a new UIView and wanted it to slide in from the left side of the screen, if I called CGAffineTransformTranslate at the same time that I created and added the view, I would have to define the view’s frame at it’s final on screen location.

    Alternatively one could call CGAffineTransformTranslate in a timer method. In this case you would define the view’s frame off screen, add it to the display and create the timer. The timer method would then move it on screen with CGAffineTransformTranslate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some problems creating a view for a node within my website. The
I am having a small problem creating a link. My view: <%= link_to 'slet',
How can I (if possible) get to the ModelMetadata from a view without creating
Can anyone recommend a way of creating a view where users can upload images
I'm unclear on the best way to have multiple view models that derive from
I'm creating a tabled like view of data in divs. I am having to
When creating a view and setting group by value some field, it groups only
Can rails handle creating a view without a controller? For example, let say I
I am creating an SQL view for a file that strips out the spaces
In MVVM pattern I don't want to think about the view while creating the

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.