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

  • Home
  • SEARCH
  • 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 4609132
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:56:36+00:00 2026-05-22T00:56:36+00:00

I place a play.png image onto my view. When the view initially loads, the

  • 0

I place a play.png image onto my view. When the view initially loads, the iPhone 4 grabs the corresponding play@2x.png file and it looks great. However, when I tap the play button my code swaps it out for the pause.png file. Then, when I tap the pause.png to bring back the play.png it uses the original play.png file (not the @2x version like I thought it would automatically reference).

This is the code I tried to use:

[button setImage:[UIImage imageNamed:@"play.png"] forState:UIControlStateNormal];

So, if I swap files after the initial view load, do I have to manually specify the @2x version inside an IF statement? If so, is the UIScreen.scale the best attribute to use for this?

I’m currently using code like this:

if ([UIScreen mainScreen].scale > 1.0) 
{ 
    [button setImage:[UIImage imageNamed:@"play@2x.png"] forState:UIControlStateNormal]; 
} 
else 
{ 
    [button setImage:[UIImage imageNamed:@"play.png"] forState:UIControlStateNormal]; 
}

It’s working fine but having the IF statement in there is annoying and seems a little fragile.

Thanks in advance to all you smarties out there.

  • 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-22T00:56:37+00:00Added an answer on May 22, 2026 at 12:56 am

    I can confirm that this is a problem with the 4.0 device. The problem is not that it does not load the @2x image, it does indeed, but still displays it at 72 DPI (causing it to be blurry).

    This bug is fortunately fixed in 4.1 (tested in the emulator).

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

Sidebar

Related Questions

I want a simple audio file to play when a web page loads. var
I tried to play with php,however I got stuck at one place, where I
I place the .html (which consist of the .js web link) file in the
If I decide to place this in my .htaccess file: IndexIgnore */* RewriteEngine ON
I've a div and inside the i place a image using img tag and
In my application i am going to place a video player that can play
I've currently an url like that : play.php?place=idplace&event=idevent I've enabled friendly url this way
In our CMS, we have a place in which we enable users to play
I am doing an android app, I want to drag an image and place
I'm trying to play with image resizer and I got the following code if

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.