开发者

Route touch event to view beneath UIScrollView if swipe gesture is not recognized - like iPad Twitter app

Let's say I've got this view hierarchy. Note this is very similar to the Twitter iPad app, so take a look at that as a reference.

 Views on top:
+--------------------+
|      |      |      |
|      |      |      |
|  S1  |   V1 |  S1  |
|      |      |      |
|      |      |      |
+--------------------+

 Views beneath
+--------------------+
|      |             |
|      |             |
|  T1  |    V        |
|------|             |
| B  B |             |
+--------------------+

V1: An opaque view, a subview of scrollview S1.

S1: UIScrollView, filling up bounds of window, with transparent background. Only needs to scroll its contents horizontally. Note the rectangles either side of V1 are transparent.

T1: A UITableView, underneath S1 (visible)

B: A UIButton, underneath S1 (visible)

V: The root view, with child views: T1, B, B, S1

I would like to replicate behaviour similar to the Twitter iPad app, specifically:开发者_JAVA技巧

• If I horizontally drag anywhere in S1 (even the transparent areas) it scrolls horizontally.

• If I interact with T1 or tap B buttons, they behave normally

Note that the answer at UIScrollView like Twitter app for iPad is close, but does not handle drag scrolling in the transparent areas of the top scroll view (S1). This question is specifically about that problem.


you can try this instead

https://github.com/raweng/StackScrollView

this may help to solve ur problem !

it supports :

  • Orientation (both Landscape & Portrait)

  • Swipe Gestures

  • Bouncing Effect

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜