Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] LinearGradientBrush doesn't fill the pages upon orientation change on iOS #11800

Closed
CMarcher opened this issue Aug 16, 2020 · 0 comments · Fixed by #11811
Closed

[Bug] LinearGradientBrush doesn't fill the pages upon orientation change on iOS #11800

CMarcher opened this issue Aug 16, 2020 · 0 comments · Fixed by #11811
Assignees
Labels
a/brushes e/2 🕑 2 in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Milestone

Comments

@CMarcher
Copy link

Description

When I set the background of a ContentPage or NavigationPage to a LinearGradientBrush, then change the orientation of the device running the app, the background rotates as it should, but it does not redraw properly to fill the screen. When a ContentPage's background is set to a LinearGradientBrush then rotated, a white bar is visible on the edge depending on the starting orientation. Whereas when a NavigationPage's BarBackground is set to a LinearGradientBrush, the gradient appears to stack horizontally.

Steps to Reproduce

  1. Create a new ContentPage or NavigationPage
  2. Set the Background or BarBackground property to a LinearGradientBrush with Start/EndPoints and Offsets of your choosing.
  3. Rotate the emulator / device screen.

Expected Behavior

Gradient redraws to fill the screen properly.

Actual Behavior

Gradient rotates but doesn't fill screen, either leaving a white bar or another gradient stacks horizontally on it. NavigationPage gradient doesn't seem to have issues on a 13.6 device, but still white bar for ContentPage.

Basic Information

  • Version with issue:

  • Last known good version: None, issue ever since the experimental version released with Xamarin Forms 4.8.

  • IDE: Visual Studio 2019, version 16.7

  • Platform Target Frameworks:

    • iOS: 13.6, though screenshots on physical device on 12.4.5.
  • Nuget Packages:

    • EntityFramework (6.4.4),
    • NetStandard.Library (2.0.3),
    • sqlite-net-pcl (1.7.335),
    • Syncfusion.Licensing (18.2.0.48),
    • Syncfusion.Xamarin.Buttons (18.2.0.48),
    • Syncfusion.Core (18.2.0.48),
    • Syncfusion.Xamarin.SfChart (18.2.0.48),
    • Syncfusion.Xamarin.SfListView (18.2.0.48),
    • Syncfusion.Xamarin.SfTabView (18.2.0.48),
    • Xamarin.Essentials (1.5.3.2),
    • Xamarin Forms (4.8.0.1269)
  • Affected Devices:
    Phone and Tablet.

Screenshots

Reflector 3 Screenshot 5
Reflector 3 Screenshot 6
Reflector 3 Screenshot 7
Reflector 3 Screenshot 8
Reflector 3 Screenshot
Reflector 3 Screenshot 2
Reflector 3 Screenshot 3
Reflector 3 Screenshot 4

Workaround

You can set the Background property of a StackLayout, AbsoluteLayout, etc. that fills the screen, will redraw properly. Can't find workaround for NavigationPage.BarBackground, apart from not setting Background entirely and using a custom renderer instead.

@CMarcher CMarcher added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 16, 2020
@samhouts samhouts added this to New in Triage Aug 16, 2020
@jsuarezruiz jsuarezruiz self-assigned this Aug 17, 2020
@jsuarezruiz jsuarezruiz added e/2 🕑 2 and removed s/unverified New report that has yet to be verified labels Aug 17, 2020
@jsuarezruiz jsuarezruiz moved this from New to Ready For Work in Triage Aug 17, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 17, 2020
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Aug 17, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Aug 17, 2020
@samhouts samhouts removed this from In Progress in vCurrent (4.8.0) Aug 18, 2020
@samhouts samhouts added this to In Progress in vNext+1 (5.0.0) Aug 18, 2020
@samhouts samhouts added this to To do in iOS Ready For Work Aug 23, 2020
@samhouts samhouts removed this from Ready For Work in Triage Aug 23, 2020
@samhouts samhouts moved this from To do to In progress in iOS Ready For Work Aug 23, 2020
iOS Ready For Work automation moved this from In progress to Done Oct 30, 2020
vNext+1 (5.0.0) automation moved this from In Progress to Done Oct 30, 2020
rmarinho added a commit that referenced this issue Oct 30, 2020
…ixes #11800

* Update the page gradient layer with device rotation changes

* Added NativeView NRE protection

* Fixed build error

* Fixed build error

* Fixed build error

Co-authored-by: Rui Marinho <me@ruimarinho.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/brushes e/2 🕑 2 in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
Development

Successfully merging a pull request may close this issue.

3 participants