views:

43

answers:

2

Hello! I’ve got a view that has to be presented both in landscape and portrait. The transition between different orientations is done by repositioning and resizing the subviews. One of the subviews is a button (plain UIButton with an image background). When the interface rotates to landscape, the button starts misbehaving – it can only be tapped on its left part, the right part does not respond. When I move the button a bit to the left, the tappable part grows. The button should not be obscured by any other view, it’s clearly visible. When I override the hitTest:withEvent: method in the parent view, I see that the taps in the “numb” part of the button result in nil being returned. I think I have seen this behaviour once before, but unfortunately I’ve forgotten the source of the problem :) Any help?

+1  A: 

Ah yes, I forgot to resize the view itself. Thus the button was on the boundary of the view and even though it was not clipped, the part lying outside the view frame was not considered for hit tests.

zoul
A: 

Can you post a more detailed description how you fix your problem? I had the same issue and can`t fix it.

Thanks!

floxxxy