質問

I have UIButtons added on the fly inside a UIScrollView and I also have a “LongPressGesture” attached to the button so when I tap the button for more than 1 second, a menu pops up (using UIMenuController).

The problem is if I keep dragging my UIScrollView the menu does not move with the button which looks weird. But I am really looking for is to STOP the UIScrollView from scrolling once the UIMenuController appears.

A perfect example is iMessage: You can drag all the messages up and down, but once you long press a message and the menu pops up, you CANNOT scroll anymore...

役に立ちましたか?

解決

Can you not simply call -setScrollEnabled: on the scroll view and pass NO when you pop up your UIMenuController? You'd need to find a way to re-enable scrolling when the menu dismisses, but at least the scroll view would refuse to scroll until that happens...

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top