iphone - How to make UIButton respond only to touch, not drag -


take @ method:

[textbutton addtarget:self action:@selector(articlemodalwillappear:) forcontrolevents:uicontroleventtouchdown];

when button touched, calls articlemodalwillappear:. works well. problem button calls action when dragged. (the button big , contains text paragraph)

i put 6 such buttons subviews of uiscrollview (with uipagecontrol). works when dragging uiscrollview horizontally. pops modal views when dragging vertically because when finger dragging across button, button considers touch, , touch calls articlemodalwillappear:.

if still don't understand problem, think new york times ipad app. can drag pages horizontally. can touch article description go full article view. nothing happens when drag vertically inside article description. how achieve this?

use different event e.g.:

[textbutton addtarget:self action:@selector(articlemodalwillappear:) forcontrolevents:uicontroleventtouchupinside]; 

uicontroleventtouchupinside used in case.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -