Good evening.
Using markup very similar to that in the xamarin forms tutorial I am unable to get the behaviour I want on windows phone.. I guess this is a bug because the iphone does behave as expected.
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:a="clr-namespace:TestProject;assembly=TestProject" x:Class="TestProject.Main"> <StackLayout Orientation="Horizontal" VerticalOptions="Start"> <Image Source="https://xamarin.com/content/images/pages/forms/crm-app.png" WidthRequest="100" HeightRequest="100" /> <StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand"> <Label Text="Tthis is a test to see whether the text wraps correctly when it gets to the end on both IOS and Windows phone" /> </StackLayout> </StackLayout> </ContentPage>
On Windows Phone, the width of the label is greater than the remaining space available in the stacklayout, whereas on the iphone it wraps correctly. I have attached 2 screenshots to show this (take a look at where the text wraps on the windows phone image)
Posts
This occurs also on Android
A new label seems to have fixed it for me:
I spoke too soon.. This doesn't work either.. the label's height is too short if you do this.. I guess the height is whatever the height would have been if the label was the full width of the screen.
If you stack these, they will overlap vertically
Did anyone of you find the solution on Windows Phone??
In my case, I have a label that is horizontally centered and expanded.
It goes of the screen, when the text is greater than one line.
I solved it with width request, but with that its no more centered.
Hope to hear soon!
Kind Regards
Taimoor Janjua