Forms9Patch
Forms9Patch copied to clipboard
Text on Label and Entry not Autofitting to width
Description
I have a Xamarin.Forms app developed on Visual Studio for Mac 2019. I am using the Forms9Patch:Label and Entry controls. They are not changing the font size when Autofit="Width" is used. I have tried putting them as the root content, or in stacklayouts or grids and nothing seems to work.
Steps to Reproduce
- Add Forms9Patch:Label
- Set Autofit to Width
- Notice when the width of the control is smaller than will fit with the requested font size the font size does not reduce to fit.
Expected Behavior
Font should be reduced in size to fit to the width of the control
Actual Behavior
Text word wraps onto 2 lines OR if MaxLines is set to 1, the text is cut off.
Basic Information
- Version with issue: 2.4.9
- Last known good version: ?
- IDE: Visual Studio for Mac 2019
- Platform Target Frameworks:
- iOS: All
- Android: All
Screenshots
<Forms9Patch:Label Grid.Row="0" Grid.Column="0" AutoFit="Width" Text="Target Energy (millijoules)" VerticalTextAlignment="Center" FontSize="22" BackgroundColor="Transparent"/>
That line produces this output (note that Target Energy (millijoules) should be on one line):
In your example, what if you add Lines="1"? I just started trying this library and that was needed for my similar situation.