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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:04:19+00:00 2026-06-13T05:04:19+00:00

I have an UIImageView which has an image. The initWithFrame:(CGRect)frame looks like this: #define

  • 0

I have an UIImageView which has an image. The initWithFrame:(CGRect)frame looks like this:

#define BORDER_WIDTH_SELECTION 3
#define SELECTED_SCALE_VALUE 1.3

    self.layer.masksToBounds = NO;
    smallFrame_ = frame;
    float newX = self.center.x - ((self.frame.size.width*SELECTED_SCALE_VALUE)*0.5);
    float newY = self.center.y - ((self.frame.size.height*SELECTED_SCALE_VALUE)*0.5);
    bigFrame_ = CGRectMake(newX, newY, self.frame.size.width*SELECTED_SCALE_VALUE, self.frame.size.height*SELECTED_SCALE_VALUE);
    self.layer.borderWidth = BORDER_WIDTH_SELECTION;

then later I trigger this

- (void) setSelected {
    [self makeThumbnailBig];
    self.layer.borderColor = [UIColor colorWithRed:178.0/255.0 green:19.0/255.0 blue:50.0/255.0 alpha:1.0].CGColor;
}

- (void)makeThumbnailBig
{    
    [UIView animateWithDuration:0.2 animations:^{
        self.frame = bigFrame_;
    }];
}

The ImageView scales correctly and draws a red border, but then the image within the ImageView peaks out from underneath the border on the left by about a pixel or two. I have removed the image, but this should give you an idea of the issue:

enter image description here

Any ideas?

  • 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-13T05:04:20+00:00Added an answer on June 13, 2026 at 5:04 am

    In your code there is a line

    self.layer.masksToBounds = NO;
    

    According to the question it should be YES instead

    About extra pixels:

    When you are preparing the image size by division you could face the issue of magic image high resolution optimization. It starts by adding the fractal part to the UIImageView dimension. See Points Versus Pixels

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

Sidebar

Related Questions

I have a UIImageView which has a png image sequence loaded into it. My
I have a UIScrollView which has an UIImageView in it. I need to be
I have an image which has a relatively large area of transparency, alpha space.
I currently have an image which has every suit and value of a deck
I have a ViewController which has an embedded UIImageView . Another ViewController has a
I have a source image which has a variable width and height, which I
I have a xib which has 1 UIImageView and 1 Toolbar. Toolbar has two
I have an UIImageView which can be rotated, panned and scaled with gesture recognisers.
I have a custom UIImageView class which I use to handle multi-touch events on
I have copied class from net which inherits UIImageView. How to put that class

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.