I want something similar to how the iPhone homescreen works. I have my scrollview inside my main view, which scrolls to the right, but when you touch on the UIButtons, they become highlighted and dragging means they don't end up getting pressed but also the scrollview doesn't end up scrolling. It doesn't do this on the homescreen. How can i make it similar to this?
Asked
Active
Viewed 597 times
0

vikingosegundo
- 52,040
- 14
- 137
- 178

Andrew
- 15,935
- 28
- 121
- 203
-
you seem to have a few problems and I'm not sure exactly what you are trying to do. However, if you want the UIButton to be dragable you will have to change userinteractionenabled = NO when you want the user to drag it. – madmik3 Feb 08 '11 at 00:29
-
I believe the OP wants to allow the user to scroll the scroll view, even when a UIButton is being pressed—essentially scrolling through a touch-down-drag event. – FeifanZ Feb 08 '11 at 00:39
-
I asked this question ages ago, and have since given up. But yeah, if you try it on the iPhone homescreen, touching down on a button then dragging still allows you to drag, and yet the same doesn't happen inside my app. – Andrew Feb 08 '11 at 04:04
2 Answers
2
A touch-down-drag is a completely different event. Apple doesn't support this directly—you'd have to code it in—start tracking the touches using the gesture responders as soon as a touch-down-inside is detected, then scroll the same amount, and stop scrolling at a touch-up-outside (or inside). This would most likely fall under the category of unusual use of interface elements, and could very well get you rejected.

FeifanZ
- 16,250
- 7
- 45
- 84
0
I think this is a better answer to the question: UIScrollview with UIButtons - how to recreate springboard?