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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:08:50+00:00 2026-06-07T11:08:50+00:00

When a user clicks UIButton1(rewind button) requirement is to change the UIImage of other

  • 0

When a user clicks UIButton1(rewind button) requirement is to change the UIImage of other UIButton2(playbutton). How can i do that.

UIButton *rewindButton = [UIButton buttonWithType:UIButtonTypeCustom];
[rewindButton addTarget:self action:@selector(rewind:) forControlEvents:UIControlEventTouchUpInside];
rewindButton.frame = CGRectMake(0, 0, 38, 38);
UIImage *imge = [UIImage imageNamed:@"Rewind Icon .png"];
[rewindButton setImage:imge forState:UIControlStateNormal];
UIBarButtonItem *rewind = [[UIBarButtonItem alloc] initWithCustomView:rewindButton];

-(void)rewind:(id)sender{
audioPlayer.currentTime = 0;
[timer invalidate];
ContainerViewController *viewController = [[[ContainerViewController alloc] init]autorelease];
viewController.view.frame = CGRectMake(0, 0, 320, 480);
[self.view addSubview:viewController.view]; 
[self.view addSubview:toolbar];
self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
                                    target:self
                                    selector:@selector(displayviewsAction:)
                                    userInfo:nil
                                    repeats:NO];
}

//Add Play Button

_playButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_playButton addTarget:self action:@selector(playpauseAction:) forControlEvents:UIControlEventTouchUpInside];
_playButton.frame = CGRectMake(0, 0, 38, 38);
[_playButton setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateNormal];
[_playButton setImage:[UIImage imageNamed:@"52.png"] forState:UIControlStateSelected];
 UIBarButtonItem *play = [[UIBarButtonItem alloc] initWithCustomView:self.playButton];


-(void)playpauseAction:(id)sender {
 if([audioPlayer isPlaying])
{
    [sender setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateSelected];
    [audioPlayer pause];
    [self pauseTimer];
    [self pauseLayer:self.view.layer];

}else{
    [sender setImage:[UIImage imageNamed:@"pause icon.png"] forState:UIControlStateNormal];
    [audioPlayer play];
    [self resumeTimer];
    [self resumeLayer:self.view.layer];
   if(isFirstTime == YES)
    {
        self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
                                            target:self
                                            selector:@selector(displayviewsAction:)
                                            userInfo:nil
                                            repeats:NO];
        isFirstTime  = NO;
    }
    } 
    }

When a user clicks UIButton1(rewind button) requirement is to change the UIImage of other UIButton2(play button)from play icon.png to pauseicon.png.

How can i do that.

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-07T11:08:51+00:00Added an answer on June 7, 2026 at 11:08 am

    Does setting the button’s image directly not work?

    -(void)rewind:(id)sender{
        [_playButton setImage:[UIImage imageNamed:@"pause icon.png"] forState:UIControlStateNormal];
        //...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After my user clicks a button, I'd like that button to stay pushed during
I have a custom UIButton that has the label Name. When the user clicks
If a user clicks on a button that does a post (lets say it
When the user clicks on a button, a new ListFragment is displayed. This fragment
When a user clicks a submit button I want the form to be submitted.
I have a UIButton which the user clicks on to bring up a UIImagePickerController
I have a UIButton that I disable for a few seconds after the user
The idea is user can click a button Add Country, Country picker will come
I want to display a picker when the user clicks on a button I
I have placed a pause button in UI, where when the user clicks the

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.