Итак, у меня есть ListView, и я не могу получить текст в горизонтальной и вертикальной середине.
Я пробовал это:
<ListView x:Name="EssenListView"
ItemsSource="{Binding EssenAnTag}"
Footer=""
SeparatorVisibility="None"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
HasUnevenRows="true"
RefreshCommand="{Binding EssenLadenCommand}"
IsPullToRefreshEnabled="true"
IsRefreshing="{Binding Laedt, Mode=OneWay}"
ItemSelected="EssenGewaehlt">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<StackLayout>
<StackLayout HorizontalOptions="FillAndExpand" HeightRequest="65" BackgroundColor="{Binding BackgroundColor}">
<Label Text="{Binding Ausgabe}"
FontSize="18"
HorizontalOptions="Center"
VerticalOptions="Center"
LineBreakMode="WordWrap" />
</StackLayout>
<Label HeightRequest="15" BackgroundColor="White"/>
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Как вы можете видеть на изображении ниже, если текст маленький, он по крайней мере центрируется по горизонтали, но если текст длинный и ломается, его не по центру.