2014-07-01 39 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。 –