I'm starting in Android Development, and I'm trying to do a scrollView.
I just used a horizontalScroll view, but there is no snapping with this layout.
After some search, i found this https://github.com/ysamlan/horizontalpager.
The operation is similar to that of the iPhone but there is some trouble to use it.
How I can do a horizontal scroll view with snapping ?
Isn't ViewPager what you're looking for?
Related
I cant seem to find an option for nestedScrollView to make it horizontal instead of vertical. i have been using HorizontalScrollView but i'd like to switch to nested. Is there anyway to do this ? searching the docs i dont see it yet it does say its the same as a scrollview ?
No
I do not believe NestedScrollView can be scrolled horizontally. According to docs:
For vertical scrolling, consider NestedScrollView instead of scroll view which offers greater user interface flexibility and support for the material design scrolling patterns.
As per the text in bold, I believe NestedScrollViews were only made to scroll vertically.
While NestedScrollViews are "just like ScrollView" (link), the docs do also state that:
Scroll view supports vertical scrolling only. For horizontal scrolling, use HorizontalScrollView instead.
(Both blockquotes come from here)
There is no support to enable the Horizantal nested scrollview in android.
Support is only limited to vertical scrollview.
NestedScrollViews is not a good approach . Better approach is to use recyclerview iniside another recyclerview.
I am searching for a view pager which should have horizontal and vertical scrolling in one class.It should just need to specify the property which type of scroll we want.How can i achieve this.
Hope this link will be helpful for you: https://android-arsenal.com/details/1/1863. It has both vertical and horizontal features.
I am stuck in one situation...I have my parent layout as a scrollable layout. Inside this layout, I have a webview and a tablelayout. Some data are inflated in this scrollable layout.
My question is, my vertical scrollable functionality seems to be disabled since my scrollable layout already have the functionality. I hardly can scroll up and down inside the webview. And same situation for Mapview. I can only zoom in and zoom out using horizontal gesture. I wonder if there is any way to disable the scroll functionality only when I zoom in/out, scroll up/down in mapview/webview. Thank you so much.
I'm trying to figure out the best approach to design a horizontal scrollview from android >= 2.1 with some text over the image that when scroll if end is reached it starts showing the first items again hence carousel behavior.
You can continue scrolling horizontally, forever, and the first item shows up again when the end is reached, for example when scrolling swiping to the left. It can be a view pager with an adapter, a carousel but not horizontal scrollview as it does not support some android device.
Any suggestions would be greatly appreciated.
Why not use a ViewPager? As it is available in the Support Library. I would insist to use ViewPager instead of HorizontalScrollView or Gallery. You can check an example for ViewPager from my github.
UPDATE
To show multiple views inside a Fragment you can use getPageWidth(). Check here for reference.
For future people looking for this, here's an excellent library that fit my needs for a similar problem!
https://github.com/sparrow007/CarouselRecyclerview
Can any one tell me how i can set my scroll view with both vertical and horizontal scroll ?
You can't. ScrollView is vertical scroll. HorizontalScrollView is horizontal scroll.
The only View (in the SDK) that I know of that has both vertical and horizontal scroll is the WebView. See if you can work with that. If not, you'll have to create your own View.
If you need both horizontal and vertical scrolling, you shouldn't be using ScrollViews. Instead, as this question points out, you can use a combination of FrameLayouts and RelativeLayouts to achieve the desired effect.