0
我試圖實現對內置Xamarin.Forms應用時間軸卡片狀記錄列表,這是或多或少我需要複製的佈局:如何在Xamarin.Forms中使用Frame作爲ListView的根元素?
我想我靠近,我有身後,我的代碼,我給你當的ItemSource對XAML側的ListView兩個記錄,這是我的結果至今:
但正如你所看到的,元素在它們的框架內根本不顯示,如果我用TextCells或ImageCells替換表單控件,數據顯示正常。這是XAML代碼,我到目前爲止有:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage Title="AudioBitts"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AudioBitts"
x:Class="AudioBitts.TimelinePage">
<ListView x:Name="listView">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell Height="300">
<Frame HasShadow="true" Margin="5">
<StackLayout>
<StackLayout Orientation="Horizontal">
<Image Source="{Binding UserAvatar}" />
<Label Text="{Binding UserName}" />
</StackLayout>
<Image Source="{Binding BittImage}" />
</StackLayout>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
我失去了對我給我的XAML代碼結構的東西嗎?謝謝!