We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
i have this simple demo xaml width a binding:
<?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:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core" ios:Page.UseSafeArea="True" xmlns:htmlLabel="clr-namespace:LabelHtml.Forms.Plugin.Abstractions;assembly=HtmlLabel.Forms.Plugin" x:Class="HtmlLabelTest.MainPage"> <StackLayout> <htmlLabel:HtmlLabel Text="{Binding HtmlString}" /> </StackLayout> </ContentPage>
and updated via nuget to version 5. With version 5 the text flows outside the screen: with version 4.1.3 it works as it should be:
The text is only a demo string. If it is a real html string the behavior is the same.
Demo: HtmlLabelTest.zip
The text was updated successfully, but these errors were encountered:
Does anyone know what this is supposed to accomplish, asking because when I commented out this method this issue was solved.
public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint) { if (!_perfectSizeValid) { _perfectSize = base.GetDesiredSize(double.PositiveInfinity, double.PositiveInfinity); _perfectSize.Minimum = new Size(Math.Min(10, _perfectSize.Request.Width), _perfectSize.Request.Height); _perfectSizeValid = true; }
var widthFits = widthConstraint >= _perfectSize.Request.Width; var heightFits = heightConstraint >= _perfectSize.Request.Height; if (widthFits && heightFits) return _perfectSize; var result = base.GetDesiredSize(widthConstraint, heightConstraint); var tinyWidth = Math.Min(10, result.Request.Width); result.Minimum = new Size(tinyWidth, result.Request.Height); if (widthFits || Element.LineBreakMode == LineBreakMode.NoWrap) return result; var containerIsNotInfinitelyWide = !double.IsInfinity(widthConstraint); if (containerIsNotInfinitelyWide) { var textCouldHaveWrapped = Element.LineBreakMode == LineBreakMode.WordWrap || Element.LineBreakMode == LineBreakMode.CharacterWrap; var textExceedsContainer = result.Request.Width > widthConstraint; if (textExceedsContainer || textCouldHaveWrapped) { var expandedWidth = Math.Max(tinyWidth, widthConstraint); result.Request = new Size(expandedWidth, result.Request.Height); } } return result; }
Sorry, something went wrong.
No branches or pull requests
Hi,
i have this simple demo xaml width a binding:
and updated via nuget to version 5. With version 5 the text flows outside the screen:
with version 4.1.3 it works as it should be:
The text is only a demo string. If it is a real html string the behavior is the same.
Demo:
HtmlLabelTest.zip
The text was updated successfully, but these errors were encountered: