2

有没有人有任何建议允许 ScrollView 允许向任何方向滚动。

似乎只有水平和垂直 ScrollOrientation 但没有同时做这两个选项的选项。

我的最终目标是能够捏合、缩放和滚动任何方向。

4

3 回答 3

3

这是你如何做到的。

var scroller = new ScrollView { Content = grid, Orientation= ScrollOrientation.Horizontal, VerticalOptions=LayoutOptions.FillAndExpand };
var vScroller = new ScrollView (){Content=scroller};
Content = vScroller;
于 2014-11-11T03:20:52.023 回答
3

Xamarin Forms 滚动视图的Orientation属性现在接受Both作为值。它在两个方向上滚动。我正在使用 Xamarin Forms 版本 2.3.0.49。

<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Orientation="Both">

于 2016-06-27T03:17:48.927 回答
0

ScrollOrientation不是[Flags]枚举且不包含Both值,因此我目前不支持此功能。但这可以工作:

new ScrollView {
    Orientation = ScrollOrientation.Vertical,
    Content = new ScrollView {
        Orientation = ScrollOrientation.Horizontal,
        Content = your_content_goes_here,
    }
}
于 2014-07-01T11:16:11.077 回答