Can’t tap button after interface rotation

Posted by zoul on Stack Overflow See other posts from Stack Overflow or by zoul
Published on 2010-06-17T06:24:17Z Indexed on 2010/06/17 6:43 UTC
Read the original article Hit count: 397

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?

© Stack Overflow or respective owner

Related posts about uibutton

Related posts about interface-orientation