-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Editor Scaling creating new lines on older iOS versions #25581
Description
Description
The issue is when an editor is scaled down on older iOS versions, the text splits in the middle and moves on to the next line causing text to seem to disappear.
This issue was believed to be fixed with: #24859.
Removing the call to SizeThatFits seemed to not cause this scaling issue but it turns out this is only on iOS 17 and up.
On iOS 15.5, the bad editor scaling behavior is still present and on iOS 16.4, it seems that there is still slightly different, but wrong behavior.
Some things I've tried
- I removed all references to the Placeholder label to see if that subview was doing anything strange and it does not look like this has any effect. Also removing the other calls in LayoutSubviews to UpdatePlaceholderLabelFrame() and ShouldCenterVertically() do not affect this behavior which leads me to believe this issue is happening on the backend of things.
- It seems like the issue may be related to the ContentSize and the Bounds when scaling happens and these could perhaps be differences in how the different iOS versions handle it?
Inside the MauiTextView.LayoutSubviews method, I am setting a breakpoint and scaling down the editor by 0.5 and then scaling it back up to 1.0. It appears that there are two passes in the LayoutSubviews call and I capture the Bounds and ContentSize. The first image below shows iOS 17.0 and the second shows iOS 15.5. You'll even see when the editor on iOS 15.5 is at the full scale and appears on one line, it still has a much larger ContentSize.Height than the iOS 17.0 equivalent.
Steps to Reproduce
By adding the following code and then sliding the slider value, you'll see the editor will split the text into two lines on iOS 15.5 but not iOS 17+
<ScrollView>
<VerticalStackLayout>
<Slider
x:Name="mySlider"
Minimum="0.5"
Maximum="1"
Value="1"/>
<Editor
x:Name="myEditor"
Text="1234567890"
Scale="{Binding Value, Source={x:Reference mySlider}}"
Background="Red"
FontSize="32"
HorizontalOptions="Center"
HorizontalTextAlignment="Center" />
</VerticalStackLayout>
</ScrollView>Link to public reproduction project repository
No response
Version with bug
8.0.92 SR9.2
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15.5 - iOS 16.4
Did you find any workaround?
No response
Relevant log output
No response



