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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:47:58+00:00 2026-06-07T22:47:58+00:00

By default, UIImageView displays his image as 1px of image = 1pt in UIImageView,

  • 0

By default, UIImageView displays his image as 1px of image = 1pt in UIImageView, but I’d like to display as 2px of image = 1pt.

Version of saving image with name “..@2x..” is not suitable, images are not saving in file system.

For example, image size is 400×100, I want to display the image on center of display, and it should be 120 pt on the left and 120 pt on the right of the image(640-400) / 2

  • 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-07T22:48:01+00:00Added an answer on June 7, 2026 at 10:48 pm

    That’s quite easy, note that for the versions below iOS 4 you don’t have Retina displays, that’s why in the image scaling method i’m doing this check first:

    //Retina detect
        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2){
    

    and then having image loaded from somewhere (file, cache, etc.) i’m scaling it this way

    UIImage * image2Xscaled = [UIImage alloc];
                image = [[image2Xscaled initWithCGImage:[image CGImage] scale:2.0 orientation:UIImageOrientationUp] autorelease];
    

    The method

    initWithCGImage:scale:orientation:
    

    is available at iOS 4.0. that’s why you need the first check. If sale is not supported, return the 1.0 scaled image.

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

Sidebar

Related Questions

I'm trying to display an image from a URL in a UIImageView and I'm
I've added a Default-568h@2x.png launch image to my app. The app needs to display
- (void)fadeOutSplash { UIImageView *splash = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@Default-Landscape~ipad.png]]; [self.window.rootViewController.view addSubview:splash]; // <--
Default JVM uses maximum 1.5 GB RAM/JVM Java application. But my Server have 8
By default, the ordered list looks like this: There are some spacing on the
By default, an unstyled set of nested <ul> lists looks like this (in Chrome,
I have a simple app that just displays a UIImageView. For some reason the
I have a Default.png for my splash screen image at my iphone app. After
In my app, I need to display a splash screen.I collect the image from
The thumbnail image shown in the info view of Maps app is UIImageView or

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.