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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:25:12+00:00 2026-05-16T06:25:12+00:00

I have a UIImageView object that I rotate with frame property and CFAffineTransformMakeRotate and

  • 0

I have a UIImageView object that I rotate with frame property and CFAffineTransformMakeRotate and then I want ot move it with moving origin of its frame, but my image moves and reshape strangly.

 @implementation TimberView

  • (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { // Retrieve the touch point CGPoint pt = [[touches anyObject] locationInView:self]; startLocation = pt; [[self superview] bringSubviewToFront:self]; }

  • (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { // Move relative to the original touch point CGPoint pt = [[touches anyObject] locationInView:self]; CGRect frame = [self frame];

    frame.origin.x += pt.x - startLocation.x; frame.origin.y += pt.y - startLocation.y; [self setFrame:frame]; }

The TimberView class is a subclass of UIImageView

  • 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-16T06:25:13+00:00Added an answer on May 16, 2026 at 6:25 am

    Quote from UIView’s frame property reference:

    If the transform property is also
    set, use the bounds and center
    properties instead; otherwise,
    animating changes to the frame
    property does not correctly reflect
    the actual location of the view.

    So if you apply some custom transform to your view you cannot use view’s frame property. To move the view change its center property instead, so your code should be transformed to (not sure if the code is correct or not):

    - (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
    {
        // Move relative to the original touch point
        CGPoint pt = [[touches anyObject] locationInView:self];
        CGPoint newCenter;
    
        newCenter.x += pt.x - startLocation.x;
        newCenter.y += pt.y - startLocation.y;
        [self setCenter: newCenter];
    }
    

    If you want just to position view’s center to touched point you can use the following code:

    UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView: [self superview]];
    self.center = touchPoint;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an UIImageView which I want to rotate a little bit, but I
I have a UIImageView object that when clicked it will play a animation, I
Example: I have an class that inherits from UIImageView. An object creates an instance
I have a UIImageView showing a image that is larger than it's frame. It's
I have a UIImageView object in one of my classes, but I need to
i have a UIImageView object that i'm trying to get x coordinate of. I
I have a UIImageView object created in IB, and has an outlet. I want
Say I have a UIImageView that contains an image of an object that is
I have an UIImageView object in one of my viewController view that is preloaded
I have an object that return a cached image view (UIImageView), which do 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.