0

Well, I'm trying to put a viewflipper inside a scrollview.

If I don't use the scrollview, my viewflipper works properly. When I put it inside a scrollview, the swipe becames hard to do. The swipe happens only if I slide only left to right, if I slide slighty up or down during this action, my viewflipper doesn't activate its onTouch event.

I think there's a conflit with the onTouch event on scrollview and viewflipper, but I don't know how to hold this event properly.

I saw a lot of questions about scrollView inside a viewflipper, but that is not my case.

@Edit I'm using Android 2.1. The layout below is what I want to do.

viewFlipperInsideScrollView

I will have a layout on the left and a viewflipper on the right. The viewFlipper would supports slides from left to right and viceversa to navigate between some forms.

Leandro Silva
  • 804
  • 1
  • 9
  • 28

1 Answers1

0

Normally android decides which scroll should be activated according to the first direction of your input.

Horizontal moves should activate the ViewFlipper while vertical should trigger the ScrollView. I am not sure if a ViewFlipper in a ScrollView is a good idea at all as a ViewFlipper probably was designed to contain scrollable Views while the ScrollView shouldn't have any scrollable content inside (at least for backwards compatibility).

On what device and version do you experience this problem and is why have you a ViewFlipper inside a ScrollView and not vice versa?

edit:

Well, android 2.1 is pretty old and always had trouble with scrollable content inside scrollable content. Even 2.3.7 (so all below 3.x) have trouble with that.

Two solutions: Use a different layout or don't support Android below 3.x. The rest will literally tear you apart while trying...

WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
  • the problem is: this is an enterprise application, and I need to support Android 2.1 :( I will try a different behaviour, maybe manipulating the dispatchEvent from scrollView ... I don't know, but I won't give up ... not yet – Leandro Silva Aug 22 '12 at 12:24