Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

C# Center ListView items on Xamarin Form

$
0
0

Hello, I have a ListView with items that include multiple Label in them.
This is the XAML
<ListView.ItemTemplate> <DataTemplate> <ViewCell> <ViewCell.View> <StackLayout Orientation="Horizontal" Padding="10,5,5,10"> <Label Text="{Binding Time}" HorizontalOptions="StartAndExpand"></Label> <Label Text="{Binding TeamOne}"></Label> <Label Text="{Binding ScoreTeamOne}" BackgroundColor="Gray" TextColor="White" HorizontalTextAlignment="Center" WidthRequest="25" MinimumWidthRequest="25"></Label> <Label Text="{Binding ScoreTeamTwo}" BackgroundColor="Gray" TextColor="White" HorizontalTextAlignment="Center" WidthRequest="25" MinimumWidthRequest="25"></Label> <Label Text="{Binding TeamTwo}"></Label> <Label Text="{Binding Tip}" HorizontalOptions="EndAndExpand"></Label> </StackLayout> </ViewCell.View> </ViewCell> <!--<TextCell Text="{Binding Name}" Detail="{Binding Description}"></TextCell>--> </DataTemplate> </ListView.ItemTemplate>

As you see they are not centered. What I want to achieve is have the scores centered in the middle and the rest to follow.
Any ideas?


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>