[英]ItemsControl with ItemsWrapGrid in uno platform
我正在嘗試構建一個 ItemsControl,其中有一個自動元素在里面排列 ItemsWrapGrid(取決於 window 大小)。 這一切都在 uwp 中工作。 但是對於 uno 平台 ItemsWrapGrid 不完全支持。
我無法設置 itemsHeight、itemsWidth 或方向。 有沒有類似的解決方法。 也許使用 GridView 而不是 ItemControl?
我的代碼:
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid ItemsHeight="200" ItemsWidth="300" Orientation="Horizontal">
</ItemsWrapGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
實際上,由於 處理虛擬化的方式, ItemsWrapGrid
僅支持 Uno 平台上的GridView
或ListView
。 如果您使用GridView
而不是ItemsControl
它應該可以工作。
另請注意,如果您想支持 WebAssembly, ItemsWrapGrid
尚不支持。 作為一種解決方法,您可以在那里使用WrapPanel
。 例如,您可以查看 UADO 參考應用程序中的GridView
樣式。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.