maui icon indicating copy to clipboard operation
maui copied to clipboard

Setting ScrollView.Orientation has no effect on iOS

Open Glorfindel83 opened this issue 2 years ago • 2 comments

Description

No matter what value I set for a ScrollView's Orientation property, I can scroll in all directions on iOS.

Simulator Screen Shot - iPhone SE (3rd generation) - 2023-02-17 at 10 16 19

Steps to Reproduce

  1. Create a new .NET MAUI App (I'm targeting .NET 6.0, not sure if that makes a difference)
  2. Replace the XAML of the MainPage with
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyMAUIApp.MainPage">
    <ScrollView Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Red">
        <BoxView HeightRequest="800" WidthRequest="800" Color="Transparent">
            <BoxView.Background>
                <LinearGradientBrush>
                    <GradientStop Color="Yellow" Offset="0.1" />
                    <GradientStop Color="Green" Offset="1.0" />
                </LinearGradientBrush>
            </BoxView.Background>
        </BoxView>
    </ScrollView>
</ContentPage>
  1. Remove everything but the constructor in MainPage.xaml.cs, to make sure the project compiles
  2. Run the app on an iPhone SE simulator
  3. Observe that you can scroll both horizontally and vertically (see screenshot above)

Link to public reproduction project repository

n/a

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16.2

Did you find any workaround?

Listen to the Scrolled event and make sure it always scrolls to 0, e.g. with

HorizontalScrollView.ScrollToAsync(e.ScrollX, 0, false);

Relevant log output

No response

Glorfindel83 avatar Feb 17 '23 09:02 Glorfindel83

Perhaps related: https://github.com/dotnet/maui/issues/7811 and https://github.com/dotnet/maui/issues/7979

Glorfindel83 avatar Feb 17 '23 09:02 Glorfindel83

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost avatar Feb 17 '23 15:02 ghost