我正在嘗試在我的 Xamarin 專案中實作這一目標

所以我想要的是Category像這樣從我的物體中顯示我的影像,有些會水平擴展,有些會在一行中顯示兩個。
我到目前為止所取得的成就是這樣的。

這是我的代碼
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="AppCrijoya.Views.CategoryPage">
<ContentPage.Content>
<StackLayout>
<ListView x:Name="listTemp" HasUnevenRows="True" IsPullToRefreshEnabled="False" ItemTapped="ListViewCategorias_ItemTapped" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid HorizontalOptions="FillAndExpand" VerticalOptions="Start" HeightRequest="270" RowSpacing="6">
<Image Source="{Binding Image}" Aspect="Fill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></Image>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
<ContentPage.ToolbarItems>
<ToolbarItem Text="CERRAR SESIóN" Clicked="Logout_Clicked"/>
</ContentPage.ToolbarItems>
</ContentPage>
請幫忙,我是 Xamarin 的新手,我仍在嘗試了解視圖的作業原理。
uj5u.com熱心網友回復:
您可以簡單地使用
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/473893.html
