xamarin/Xamarin.Forms

Inconsistent behavior of StackLayout and ScrollView on iOS

Open

#5,321 opened on Feb 20, 2019

 (2 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
e/5 :clock5:help wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

A StackLayout (and other layouts) and a ScrollView behave differently after hiding the NavigationHeader. If NavigationHeader is visible, then they behave equal. If the app is started fullscreen, the ScrollView and StackLayout behave the same (except devices with notch). For devices with notch, the behavior is different again.

ScrollViews and ListViews always behave in the same way.

Assuming the stack layout behavior is correct, then I don't understand the behavior of the bold marked entries (see screenshots).

Steps to Reproduce

  1. Wrap a ContentPage into a NavigationPage
  2. Hide NavigationHeader
  3. Compare the behavior of a page with StackLayout and a page with Scrollview as root element.

Expected Behavior

The start position of the control itself and its content should be the same for a StackLayout and a ScrollView.

Actual Behavior

If NavigationHeader was hidden, they behave differently. If the app is in fullscreen mode and the NavigationHeader is hidden, then they behave the same on an iPhone 5s, on an iPhone X, they behave differently.

  • Version with issue: Tested with 3.5.0 & 3.3.0 Last known good version: -

Screenshots

ScrollViews background color is fuchsia StackLayouts background color is red

Description iPhone 5s iPhone X
StackLayout image image
ScrollView image image
StackLayout without Nav image image
ScrollView without Nav image image
StackLayout FullScreen (FS) image image
ScrollView FS image image
StackLayout without Nav FS image image
ScrollView without Nav FS (wrong behavior on iPhone X) image image

Reproduction Link

https://1drv.ms/u/s!AlBXM4w3Fjp8g64E4jJvHnJSjOPwYg

Contributor guide