2014-07-01 24 views

回答

0

ScrollOrientation是不是[Flags]枚举,并且不包含Both值,所以这个我支持在这个时候snot。但是,这可以工作:

new ScrollView { 
    Orientation = ScrollOrientation.Vertical, 
    Content = new ScrollView { 
     Orientation = ScrollOrientation.Horizontal, 
     Content = your_content_goes_here, 
    } 
} 
+0

这不起作用。 – Lazydev

+0

这也不适合我。 – user3506776

+0

它基本上与user2986451中的代码相同,它对我很有用。你的“内容”是什么?我在内部水平滚动视图中的'StackLayout'中使用了'Label'。什么不行?只有一个滚动方向? – testing

3

这是你是如何做到的。

var scroller = new ScrollView { Content = grid, Orientation= ScrollOrientation.Horizontal, VerticalOptions=LayoutOptions.FillAndExpand }; 
var vScroller = new ScrollView(){Content=scroller}; 
Content = vScroller; 
+2

它确实有效,但它不允许对角滚动。 – Arnstein

1

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

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

+0

这对我不起作用。它导致运行时异常。 Xamarin表格版本2.3.3.180。 –