views:

53

answers:

1

Hello Friends,

I am working on horizontal menu that will open on top of the screen. Layout is something like following,

|| < || Menu Item1 || Menu Item2 || Menu Item3 || > ||

I want to put this on top of the screen. It can have more than 3 menu item and it can traverse through previous and next arrow. I started with like this,

  • RelativeLayout ( width - fill_parent)

    • Gallery View ( Here i appended adapter )

There is two problem, - Gallery view contains the space before and after - While scrolling its item gets selected

Though its not ideal solution for this. How can i build custom component like this ? Any help appreciated.

Thanks

+2  A: 

If you want to use a gallery, you can override the onFling behaviour if you want to say slow down the fling or ignore vertical fling etc.

To disable the space, there is a an api call gallery.setSpacing()... To make the gallery not select when you are flinging use gallery.setCallbackDuringFling(false)

However, if all you want is a static menu that scrolls with the left and right buttons, I'd just subclass a LinearLayout and go from there.

Jack