有没有人有任何建议让ScrollView允许任何方向的滚动。ScrollOrientation.Both on Xamarin Forms ScrollView
垂直ScrollOrientation似乎只有Horizontal &,但没有选项可同时执行这两个操作。
我的最终目标是能够捏,放大&滚动任何方向。
有没有人有任何建议让ScrollView允许任何方向的滚动。ScrollOrientation.Both on Xamarin Forms ScrollView
垂直ScrollOrientation似乎只有Horizontal &,但没有选项可同时执行这两个操作。
我的最终目标是能够捏,放大&滚动任何方向。
ScrollOrientation
是不是[Flags]
枚举,并且不包含Both
值,所以这个我支持在这个时候snot。但是,这可以工作:
new ScrollView {
Orientation = ScrollOrientation.Vertical,
Content = new ScrollView {
Orientation = ScrollOrientation.Horizontal,
Content = your_content_goes_here,
}
}
这是你是如何做到的。
var scroller = new ScrollView { Content = grid, Orientation= ScrollOrientation.Horizontal, VerticalOptions=LayoutOptions.FillAndExpand };
var vScroller = new ScrollView(){Content=scroller};
Content = vScroller;
它确实有效,但它不允许对角滚动。 – Arnstein
Xamarin窗体滚动型的Orientation
属性现在接受Both
作为值。它在两个方向上滚动。我正在使用Xamarin Forms版本2.3.0.49。
<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Orientation="Both">
这对我不起作用。它导致运行时异常。 Xamarin表格版本2.3.3.180。 –
这不起作用。 – Lazydev
这也不适合我。 – user3506776
它基本上与user2986451中的代码相同,它对我很有用。你的“内容”是什么?我在内部水平滚动视图中的'StackLayout'中使用了'Label'。什么不行?只有一个滚动方向? – testing