-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed as not planned
Closed as not planned
Copy link
Labels
area-controls-scrollviewScrollViewScrollViewi/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/iost/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
If the text of a label in a ScrollView is updated, then it destroys the layout of the ScrollView.
Bug is only see in iOS. There are no problems on Android and Windows.
Version wich bug:
[8.0.0-rc.2.9511]
The bug did not occur in version 8.0.0-rc.2.9373!
Steps to Reproduce
- Create a new project > New .NET MAUI App
- Create a page with a lots of labels in a ScrollView and with one label (named "ViewCounter") far below.
- In the code behind, we start a dispatcher timer and update the text of the "ViewCounter" label every 5 seconds.
- Start the test app and scroll to the “ViewCounter” label.
- Wait and admire the bug ;o)
MainPage XAML:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="HW_Playground.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<ScrollView
Orientation="Vertical"
VerticalOptions="FillAndExpand"
VerticalScrollBarVisibility="Always">
<VerticalStackLayout
Padding="30,0"
Spacing="25"
VerticalOptions="Center">
<Image
HeightRequest="200"
HorizontalOptions="Center"
SemanticProperties.Description="Cute dot net bot waving hi to you!"
Source="dotnet_bot.png" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
x:Name="ViewCounter"
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="COUNTER"
TextColor="Red" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
<Label
FontSize="32"
HorizontalOptions="Center"
SemanticProperties.HeadingLevel="Level1"
Text="Hello, World!" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>
MainPage Code Behind:
namespace HW_Playground;
public partial class MainPage : ContentPage
{
int count = 0;
public MainPage()
{
InitializeComponent();
}
protected override void OnAppearing()
{
base.OnAppearing();
Timer.Start();
}
private IDispatcherTimer Timer
{
get
{
if ( _timer == null )
{
_timer = Dispatcher.CreateTimer();
_timer.Interval = TimeSpan.FromSeconds( 5 );
_timer.Tick += Tick;
}
return _timer;
}
}
private IDispatcherTimer? _timer;
int counter = 1;
private void Tick( object? _sender, EventArgs _eventArgs )
{
ViewCounter.Text = $"Counter: {counter++}";
}
}
Link to public reproduction project repository
No response
Version with bug
Unknown/Other
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.0-rc.2.9373
Affected platforms
iOS
Affected platform versions
iOS 17.0.3
Did you find any workaround?
Not yet.
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
area-controls-scrollviewScrollViewScrollViewi/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/iost/bugSomething isn't workingSomething isn't working