Reputation: 103
Does anyone have any suggestions to allow a ScrollView to allow scrolling in any direction.
There seems to be only Horizontal & Vertical ScrollOrientation but no option to do both at the same time.
My end goal is to be able to pinch, zoom & scroll any direction.
Upvotes: 3
Views: 4864
Reputation: 422
Xamarin Forms scrollview's Orientation
property now accepts Both
as a value. It scrolls on both direction. I am using Xamarin Forms version 2.3.0.49.
<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Orientation="Both">
Upvotes: 4
Reputation: 41
Here's how you do it.
var scroller = new ScrollView { Content = grid, Orientation= ScrollOrientation.Horizontal, VerticalOptions=LayoutOptions.FillAndExpand };
var vScroller = new ScrollView (){Content=scroller};
Content = vScroller;
Upvotes: 3
Reputation: 16232
ScrollOrientation
is not a [Flags]
enum and does not contains Both
value, so this i snot supported at this time. But this could work:
new ScrollView {
Orientation = ScrollOrientation.Vertical,
Content = new ScrollView {
Orientation = ScrollOrientation.Horizontal,
Content = your_content_goes_here,
}
}
Upvotes: 0