0
我在我的ListView
中使用名爲CardViewTemplate.xaml
的內容視圖頁面來呈現一些帶有兩個框架的內容,其中一個應該是可見的,另一個不是同時顯示的。在自定義ContentView中隱藏框架
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
...>
<Frame IsVisible="{Binding IsNotBreak}" IsClippedToBounds="True">
.... content ....
</Frame>
<Frame IsVisible="{Binding IsBreak}" IsClippedToBounds="True">
--content 2-
</Frame>
</ContentView>
和在列表視圖中用於結合和查看一些數據的ListView像下面的代碼在上述頁:
<ListView x:Name="listView" SelectedItem="{Binding SelcetedItem,Mode=TwoWay}"
RowHeight="-1"
ItemsSource="{Binding SelectedCard}" HasUnevenRows="True" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Custom:CardViewTemplate/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
出乎意料我的列表視圖僅示出了第二幀,它看起來像附加的圖像: