Hi Everyone,
I have a music player (sub-class of a UIToolbar) that has 4 UIBarButtonItems on it.
1) Fixed space
2 - 4) Back, Play, Forward buttons
Everything is functioning correctly, except the back button. The issue is that even when I tap the the left of the back button the button is still being pressed some how. The image below shows where I am tapping on the toolbar and where the button is being pressed.
The button also is working if you push down directly on top of the icon. The code that I am using to add these items to the toolbar is:
Code:
UIBarButtonItem *bufferSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
bufferSpace.width = buttonStartX; //buttonStartX = 180
backButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRewind target:self action:@selector(previousSong:)];
playButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(playPauseSong:)];
pauseButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPause target:self action:@selector(playPauseSong:)];
nextButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward target:self action:@selector(nextSong:)];
backButton.style = UIBarButtonItemStyleBordered;
playButton.style = UIBarButtonItemStyleBordered;
pauseButton.style = UIBarButtonItemStyleBordered;
nextButton.style = UIBarButtonItemStyleBordered;
NSArray *items = [[NSArray alloc] initWithObjects: bufferSpace, backButton, playButton, nextButton, nil];
[self setItems:items animated:YES];
[items release];
Any help is appreciated!