Scrolling in HorizontalScrollView

by Arjun » Tue, 07 Dec 2010 07:43:07 GMT

Sponsored Links

I have a linear layout inside a horizontal scroll view.  linear layout
has n number of images.

I am facing problem with horizontal scrolling, As soon as the user
flings, depending upon the velocity the scroll view scrolls. But my
requirement differs with the default horizontal scroll view
scrolling.  My requirement is "whatever may be the fling velocity"
user has to be shown the next three images depending upon the fling

Hence I have extended Horizontal scroll view and override fling, such
that I can scroll to the next three images, by specifying the number
of pixels it should move horizontally using scrollTo(px,px);

The above operation is not giving the expected behavior. Any thoughts
on this would be really helpful.



Re: Scrolling in HorizontalScrollView

by TreKing » Wed, 08 Dec 2010 22:56:40 GMT


Why not use a Gallery?

TreKing <> ; - Chicago
transit tracking app for Android-powered devices


Sponsored Links

Re: Scrolling in HorizontalScrollView

by prudhvi » Fri, 14 Jan 2011 21:18:41 GMT 

theres a builtin widget called viewflipper.. could be usefull a lot.


Other Threads

1. SDK 2.3: Get "Multiple substitutions specified in non-positional format" error

When this string is in my strings.xml

   <string name="home_activity_header_name">%s %s</string>

I get this error when compiling the source-code:
"error: Multiple substitutions specified in non-positional format; did
you mean to add the formatted="false" attribute"

I just upgraded to the newest tools (v 8.0.0) and downloaded the
latest SDK (2.3).
I compile under apil-leverl 8 and i tried compiling under api-level 9.

Why does this error suddenly appear?
Is there a way to get rid of it?



2. Child focus intercept

I am trying to disable a Layout including all its children. I am able
to intercept the click and key press events of the Layout in the
dispatchTouchEvent and dispatchKeyEvent and dispatchTrackBallEvent
methods of the layout. Thus, the children of this layout cannot
receive any clicks or key presses.But the child views can still
receive focus (by trackball or arrows on key board, but not by touch)
and their OnFocusChangedListeners are fired.

How can I prevent child views from receiving focus. Setting the
focusable of Layout is not working. Parsing all child views and
setting them to non focusable is too expensive in my case, as there
can be really complex run-time created view hierarchies .



3. Troubleshooting some memory leaks

4. Problem move to sd card

5. how to install a file under application files folder

6. creating a Linux device driver

7. how to make a view draw itself following my finger movement