有没有人有任何建议允许 ScrollView 允许向任何方向滚动。
似乎只有水平和垂直 ScrollOrientation 但没有同时做这两个选项的选项。
我的最终目标是能够捏合、缩放和滚动任何方向。
有没有人有任何建议允许 ScrollView 允许向任何方向滚动。
似乎只有水平和垂直 ScrollOrientation 但没有同时做这两个选项的选项。
我的最终目标是能够捏合、缩放和滚动任何方向。
这是你如何做到的。
var scroller = new ScrollView { Content = grid, Orientation= ScrollOrientation.Horizontal, VerticalOptions=LayoutOptions.FillAndExpand };
var vScroller = new ScrollView (){Content=scroller};
Content = vScroller;
Xamarin Forms 滚动视图的Orientation
属性现在接受Both
作为值。它在两个方向上滚动。我正在使用 Xamarin Forms 版本 2.3.0.49。
<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Orientation="Both">
ScrollOrientation
不是[Flags]
枚举且不包含Both
值,因此我目前不支持此功能。但这可以工作:
new ScrollView {
Orientation = ScrollOrientation.Vertical,
Content = new ScrollView {
Orientation = ScrollOrientation.Horizontal,
Content = your_content_goes_here,
}
}