【发布时间】:2016-06-27 11:17:48
【问题描述】:
有没有人有任何建议允许 ScrollView 允许向任何方向滚动。
似乎只有水平和垂直滚动方向,但没有同时做这两个选项的选项。
我的最终目标是能够在任意方向进行捏合、缩放和滚动。
【问题讨论】:
标签: xamarin.forms
有没有人有任何建议允许 ScrollView 允许向任何方向滚动。
似乎只有水平和垂直滚动方向,但没有同时做这两个选项的选项。
我的最终目标是能够在任意方向进行捏合、缩放和滚动。
【问题讨论】:
标签: xamarin.forms
这就是你的做法。
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,
}
}
【讨论】:
Content 是什么?我在内部水平滚动视图的StackLayout 中使用Label。什么不起作用?只有一个滚动方向?