带有标签+圆圈背景的 Xamarin Forms 列表视图项
Xamarin Forms listview item with label+circle background
我想在 Xamarin Forms 中为 Android 和 IOS 设计我的 ListView。
我想制作这个项目列表:
我的问题是带数字的圆圈。事实上,我不知道如何在 Xamarin Forms 中制作圆圈。
这是我的项目模板:
<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>
你能帮帮我吗?
谢谢
使用带有圆圈的标签作为背景图片,然后将文本放入其中。 Alterantely,对于网格,您可以使用带有标签(具有透明背景)的图像控件。
还有一个可能有用的 RoundedBoxView 插件。
我想在 Xamarin Forms 中为 Android 和 IOS 设计我的 ListView。
我想制作这个项目列表:
我的问题是带数字的圆圈。事实上,我不知道如何在 Xamarin Forms 中制作圆圈。
这是我的项目模板:
<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>
你能帮帮我吗?
谢谢
使用带有圆圈的标签作为背景图片,然后将文本放入其中。 Alterantely,对于网格,您可以使用带有标签(具有透明背景)的图像控件。
还有一个可能有用的 RoundedBoxView 插件。