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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:11:08+00:00 2026-05-28T02:11:08+00:00

I have placed a pause button in UI, where when the user clicks the

  • 0

I have placed a pause button in UI, where when the user clicks the button, the image of button from pause image it has to change to the start image. I have placed both the start and the pause images in the bundle, I am able to do this,but when i click on start again , it should show pause image button,How to do this, the following is the code i am using,

-(IBAction)btnClked:(id)sender
{

    [pauseButton setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];



    UIButton *btn=(UIButton *)sender;


    [btn setImage:[UIImage imageNamed:@"start.png"] forState:UIControlStateNormal];
}
  • 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-28T02:11:08+00:00Added an answer on May 28, 2026 at 2:11 am

    You need a variable to keep track of that state change. A BOOL is fine.

    But using your code, you can “abuse” the tag property of UIButton to tell if it’s playing (tag == 1) or paused (tag == 0)

    -(IBAction)btnClked:(id)sender {
         UIButton *btn=(UIButton *)sender;
         if (btn.tag == 1) {
             btn.tag = 0;
             [btn setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];
         } else {
             btn.tag = 1;
            [btn setImage:[UIImage imageNamed:@"start.png"] forState:UIControlStateNormal];
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have placed an image on the master page. I see the image at
I have an animated gif placed on the button. It's animating ok (most of
I have a countdown timer application, and when I change the orientation from vertical
What i want to do is each time user clicks the button Add and
I have a Template Column under which I have Placed a Dropdownlist. Now I
I have a horizontal list on which I have placed borders on the li
I'm using the Excel interop in C# ( ApplicationClass ) and have placed the
How to access App_Data folder in WCF service? I have placed a xslt file
I am using Ajax tab container control with 3 tabs. I have placed a
I have an Expander placed on a window with a blue background and I

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.