I'm using Xamarin.Forms and I haven't found out how to have a multiline label for UWP. In my real project I have the label in a Grid
on a ViewCell
in a ListView
. For the below example I've put it into a StackLayout
:
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Label x:Name="titleLabel" Text="some long text" LineBreakMode="WordWrap" />
<Label x:Name="valueLabel" Text="perhaps a much, much, much, much, much, much, much, much, much longer text" LineBreakMode="WordWrap" />
</StackLayout>
The code is working on iOS and Android, but not on UWP. Here the text gets cut off. If only one label and no StackLayout
is used it appears correctly on UWP with the multiline text.
I also tried to use a custom renderer with a multiline TextBlock
as label, but the result was the same - the text is cut off.
Is this a bug or am I missing something?
Edit:
Now I made a UWP project
<StackPanel Orientation="Horizontal">
<TextBlock Text="oh this is a label" TextWrapping="Wrap" />
<TextBlock Text="and this should be a very, very, very, very, very, very, very, very, very, very long text" TextWrapping="Wrap" />
</StackPanel>
and here the text is also cut off. It seems it isn't possible in UWP. Are there any other solutions/workarounds?