views:

629

answers:

2

I have a UIButton within a UIView. The button is docked on the bottom of the view using the Autoresizing Masks. The button is working fine when the view initially loads and the IBAction is being called successfully.

Now when I resize the height of the parent view the button stays docked at the bottom of the view, however now only half of the button responds to the touch events. If I resize the parent view height a bit larger then the button completely doesn't respond anymore.

Any ideas why this would be occurring?

+1  A: 

It sounds as if you've got another view, most likely a transparent one, that is resizing improperly and covering up part of the button.

TechZen
I only have a UIImageView that fills the view background. This is behind the UIButton otherwise I wouldn't see the button. I also have a UITextView docked to the left of the view. I changed the background color of this to check if this was covering part of the button and it isn't. What else could cause the problem? As the view expands the UIButton bounds and frame changes to suit the bottom docking. The size doesn't change though.
Luke
I can't think of anything else that would cause only part of standard control to stop registering touches. Does the loss of response start from top of the button and go down or start from the bottom? Is is a left/right thing? What is views/controls, if any are in that direction? Does the button's frame extend passed the bounds of the inclosing view?
TechZen
The loss of response starts at the bottom of the button. There is nothing under the button except the iPhone keyboard. The button is inside a view that I animate (as the keyboard moves into view) attached to the top of the iPhone keyboard. The button works fine after the animation is committed, the problems starts when the View height is increased.
Luke
I have resolved the issue, see my own answer. Thanks you for your help.
Luke
+1  A: 

It seems that I was moving the main view as the inner view height was changing. I guess if the UIButton is outside the bounds of the self.view then touches are not received.

Luke
Glad you figured it out. Mark this as the answer so the the system knows the question is resolved. You can answer your own questions.
TechZen