Reputation: 10969
I am currently developing an iPad application that has a Pause button. The entire pause button is played on the screen, but only the left-most portion (the left edge and then the P in PAUSE registers as a click on the screen).
The program only operates in landscape orientation, and the button is set up as follows:
UIImage *buttonImage = [UIImage imageNamed:@"pause_button.png"];
CGRect buttonFrame = CGRectMake(700.0, 400.0, buttonImage.size.width, buttonImage.size.height);
pauseButton = [self buttonWithTitle:nil target:self selector:@selector(togglePauseButton:) frame:buttonFrame image:buttonImage];
...
[self addSubview:pauseButton];
If I adjust the location from 700.0, 400.0 to 225.0, 620.0, the entire button is clickable.
Is there a way to make the entire button clickable with the 700.0, 400.0 origin point?
Upvotes: 0
Views: 588
Reputation: 169
just use
CGRectMake(700.0, 400.0, buttonImage.frame.size.width, buttonImage.frame.size.height)
Upvotes: 0
Reputation: 2720
The most likely cause here is that you have another layer swallowing touches in the area where the Pause isn't tappable.
Upvotes: 1