This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
This repository was archived by the owner on May 1, 2024. It is now read-only.
[Bug] In some cases on Forms 5.0-pre3 the screen isn't being refreshed properly on Android #12567
Copy link
Copy link
Open
Labels
5.0.0Regression on 5.0.0Regression on 5.0.0a/layouta/scrollviewblockerIssue blocks next stable release. Prioritize fixing and reviewing this issue.Issue blocks next stable release. Prioritize fixing and reviewing this issue.p/Androidt/bug 🐛
Milestone
Description
Description
I have encountered a few cases where going back (PopAsync) or changing the current page doesn't re-render the page properly on Android. I have isolated a small test sample to demonstrate this issue.
Steps to Reproduce
- Create a new XAML file with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xaminals.Views.BearsPage"
Title="Test">
<ScrollView>
<StackLayout>
<!-- Empty layout for testing, normally filled -->
<StackLayout Padding="20" HorizontalOptions="FillAndExpand" HeightRequest="1000" />
<!-- Layout with IsVisible-->
<StackLayout Padding="20">
<Button Text="Click me!" Command="{Binding ButtonCommand}" />
<StackLayout IsVisible="{Binding IsExtraVisible}">
<Label Text="Label9"
FontSize="18"
HorizontalOptions="FillAndExpand" />
<Entry Text="TestText"
Placeholder="Placeholder" />
</StackLayout>
</StackLayout>
<!-- Bottom Layout -->
<StackLayout Padding="20" HorizontalOptions="FillAndExpand" MinimumHeightRequest="32">
<Button Text="Save!"
Padding="20,0"
HorizontalOptions="FillAndExpand" />
</StackLayout>
</StackLayout>
</ScrollView>
</ContentPage>- Enter the following code in the code file of the xaml file:
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Xamarin.Forms;
namespace Xaminals.Views
{
public partial class BearsPage : ContentPage, INotifyPropertyChanged
{
public BearsPage()
{
InitializeComponent();
BindingContext = this;
}
public Command ButtonCommand => new Command(() =>
{
IsExtraVisible = true;
RaisePropertyChanged(nameof(IsExtraVisible));
});
public bool IsExtraVisible { get; set; } = false;
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}- Run the project on Android and press the Click me! button.
Expected Behavior
The StackLayout that has IsVisible should become visible and the view should properly expand the view to accommodate the newly displayed elements with the existing elements
Actual Behavior
The StackLayout becomes visible but pushes the Save! button out of frame. This can be resolved by rotating the tablet for a bit so that we force a redraw
Basic Information
- Version with issue: 5.0.0-pre3
- Last known good version: 5.0.0-pre1
- IDE: Visual Studio for Mac
- Platform Target Frameworks:
- iOS: 8.0
- Android: 10.0
- Nuget Packages: Xamarin.Forms (5.0.0-1558-pre3)
- Affected Devices: Android Simulator running Android 8.1.0, Galaxy Tab S2 running Android 7.0
Screenshots
Reproduction Link
Workaround
No workaround found yet
Metadata
Metadata
Assignees
Labels
5.0.0Regression on 5.0.0Regression on 5.0.0a/layouta/scrollviewblockerIssue blocks next stable release. Prioritize fixing and reviewing this issue.Issue blocks next stable release. Prioritize fixing and reviewing this issue.p/Androidt/bug 🐛
