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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:30:57+00:00 2026-06-04T07:30:57+00:00

I have a UIView called character. Inside that view the user can add several

  • 0

I have a UIView called character. Inside that view the user can add several UIImageView as subViews.
I created gesture methods for Pinch, Move and Rotate. The gesture method were added to the character view.

For moving I’m using the gesture translationInView property and it works fine!
My problem is with scalling.

Scaling individual UIImageViews is ok, no issues, but how to scale all of them??

I tried to scale the character view, it works fine scaling proportionally all the subviews but I don’t want to change the character view, because I use it as a canvas to place the UIImageView to compose my character. If I change the character with a CGAffineTransformScale, all the new ImageViews that I add, got the same scale.

I tried this but it doesn’t work:

   if ([gesture state] == UIGestureRecognizerStateBegan || [gesture state] == UIGestureRecognizerStateChanged) {
        CGFloat customScale = gesture.scale;
        for (UIImageView *singleView in [self.devoCharacter subviews]) {
            singleView.frame = CGRectMake(singleView.frame.origin.x / customScale, singleView.frame.origin.y /customScale, singleView.frame.size.width /customScale , singleView.frame.size.height /customScale);
            [gesture setScale:1];
        }
}

I wanted to reduce the size of each view and their relative distances in this way, but the whole thing expands from the coordinates origin.

Then I tried this:

if ([gesture state] == UIGestureRecognizerStateBegan || [gesture state] == UIGestureRecognizerStateChanged) {
        CGFloat customScale = gesture.scale;
        for (UIImageView *singleView in [self.devoCharacter subviews]) {
            singleView.transform = CGAffineTransformScale(singleView.transform, customScale, customScale);
            [gesture setScale:1];
        }
}

But this scales each view independently and does not maintain their relative distances.
Is there anyway to just scale each view, proportionally? and maintaining their relative distances as well?

  • 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-04T07:30:58+00:00Added an answer on June 4, 2026 at 7:30 am

    Ok I got how to do it. Scale every single view and then scale proportionally their centers. This solved my problem:

            for (Part *singleView in [self.canvas subviews]) {
                singleView.transform = CGAffineTransformScale(singleView.transform, customScale, customScale);
                singleView.center = CGPointMake(singleView.center.x * customScale, singleView.center.y * customScale);
                [gesture setScale:1];
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView that has several UIImageViews as subviews. Each of these subviews
I have a UIView container that has two UIImageView s inside it, one partially
I have a custom UIView class. Inside that view, there is an image view.
In my UIView, I've created a UIImageView called targetView where I have set it
I have a class that extends UIView called TouchView. That view is on the
I have a UIView subclass that draws itself when -drawRect: is called. It only
I have a UIView called activityView , which contains two subviews activityIndicator and cancelOperationsButton
I have a UIView that I want to load when the user clicks a
I have a UIView that gets loaded with several custom NSObjects (graphShape). Each graphShape
I have a class called GraphView that extends UIView that basically draws a small

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.