[英]Change the Background Color of an ListView Item on Xamarin Forms
[英]Xamarin Forms listview item with label+circle background
我想在Xamarin Forms中为Android和IOS设计ListView。
我的问题是带有数字的圆圈。 实际上,我不知道如何在Xamarin Forms中圈圈。
这是我的itemTemplate:
<ViewCell.View>
<StackLayout HorizontalOptions="FillAndExpand" Padding="10" BackgroundColor="{Binding RowColor}">
<Label Text="{Binding Name}" TextColor="White" FontSize="20"
LineBreakMode="NoWrap" />
<Grid HorizontalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Label Text="{Binding BarcodeMessage}" Grid.Column="0"
HorizontalOptions="FillAndExpand" TextColor="White" />
<Label Text="{Binding Quantity}" Grid.Column="1"
HorizontalOptions="FillAndExpand" TextColor="White" />
</Grid>
</StackLayout>
你能帮助我吗 ?
谢谢
使用带圆圈的标签作为背景图像,然后将文本放在其中。 另外,对于网格,您可以使用在其顶部分层有标签(透明背景)的图像控件。
还有一个RoundedBoxView插件可能会有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.