【发布时间】:2018-01-06 08:38:59
【问题描述】:
我想做一个黄色背景的单元格和一个带有文本的橙色框和一个中等大小的图像,但它不起作用。图片看起来不大,我不能使用边距
这是我的 XAML
<?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="neoFly_Montana.Views.PromocoesView"
BackgroundImage="promocoesbackground"
Title="Promoções">
<ContentPage.Content>
<ListView x:Name="listview_promocoes" Margin="0, 20, 0, 0 ">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout BackgroundColor="AliceBlue" HorizontalOptions="Center" VerticalOptions="FillAndExpand">
<Label Text="{Binding titulo}" Style="{StaticResource labelsfont}"/>
<Image Source="{Binding imagem}" Aspect="AspectFill"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage.Content>
这是不好的结果(有 2 个项目 - 你看不到图像)
我想做这样的事情,但我不能使用边距,因为当我使用它时,应用程序无法运行。
它必须是 ListView 的一项。 所有项目都应该是这样的。
我该怎么做? 谢谢。
【问题讨论】:
标签: xaml listview xamarin layout xamarin.forms