Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton lazy to change state from normal to highlighted

Tags:

ios

ios7

uibutton

I have a strange behavior. With Interface Builder I have defined the normal image and the highlighted image state for UIButton but if I tap quickly the button remains in the normal state (but the associated selector is call). The button change state only if I perform a long tap on it.

But if I tap quickly the image doesn't change and the button seems disabled.

If can help I have a view controller with a scroll view attached on it. On this scroll view I have attached a view (that is very long) realized with interface builder.

Ideas ?

like image 465
Fry Avatar asked Dec 06 '25 20:12

Fry


1 Answers

This is a feature of UIScrollView. It prioritizes scrolling instead of the button contained within. By setting delaysContentTouches = NO on the parent UIScrollView you should get nice, responsive buttons. However, you won't be able to scroll the parent UIScrollView while touching those buttons.

like image 122
Aaron Shekey Avatar answered Dec 08 '25 12:12

Aaron Shekey