有沒有人有任何建議讓ScrollView允許任何方向的滾動。ScrollOrientation.Both on Xamarin Forms ScrollView
垂直ScrollOrientation似乎只有Horizontal &,但沒有選項可同時執行這兩個操作。
我的最終目標是能夠捏,放大&滾動任何方向。
有沒有人有任何建議讓ScrollView允許任何方向的滾動。ScrollOrientation.Both on Xamarin Forms ScrollView
垂直ScrollOrientation似乎只有Horizontal &,但沒有選項可同時執行這兩個操作。
我的最終目標是能夠捏,放大&滾動任何方向。
ScrollOrientation
是不是[Flags]
枚舉,並且不包含Both
值,所以這個我支持在這個時候snot。但是,這可以工作:
new ScrollView {
Orientation = ScrollOrientation.Vertical,
Content = new ScrollView {
Orientation = ScrollOrientation.Horizontal,
Content = your_content_goes_here,
}
}
這是你是如何做到的。
var scroller = new ScrollView { Content = grid, Orientation= ScrollOrientation.Horizontal, VerticalOptions=LayoutOptions.FillAndExpand };
var vScroller = new ScrollView(){Content=scroller};
Content = vScroller;
它確實有效,但它不允許對角滾動。 – Arnstein
Xamarin窗體滾動型的Orientation
屬性現在接受Both
作爲值。它在兩個方向上滾動。我正在使用Xamarin Forms版本2.3.0.49。
<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Orientation="Both">
這對我不起作用。它導致運行時異常。 Xamarin表格版本2.3.3.180。 –
這不起作用。 – Lazydev
這也不適合我。 – user3506776
它基本上與user2986451中的代碼相同,它對我很有用。你的「內容」是什麼?我在內部水平滾動視圖中的'StackLayout'中使用了'Label'。什麼不行?只有一個滾動方向? – testing