Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical scrolling in <ScrollView Orientation="Both"> not working #7811

Closed
usa- opened this issue Jun 7, 2022 Discussed in #7796 · 7 comments · Fixed by #13623
Closed

Vertical scrolling in <ScrollView Orientation="Both"> not working #7811

usa- opened this issue Jun 7, 2022 Discussed in #7796 · 7 comments · Fixed by #13623
Assignees
Labels

Comments

@usa-
Copy link

usa- commented Jun 7, 2022

Discussed in #7796

Originally posted by usa- June 6, 2022
I start VS 2022 version 17.3.0 preview 1.1 (the latest one).
I create a new “.NET MAUI App” project.
In the MainPage.xaml file, I change the code inside the ContentPage element to the following:

    <ScrollView Orientation="Both">
        <Image Source="dotnet_bot.png" HeightRequest="1000" WidthRequest="1000" Aspect="AspectFit" />
    </ScrollView>

In the code-behind file, MainPage.xaml.cs, I delete the OnCounterClicked function.
In the debug destination drop-down list, I select the Android Emulator.
I run the application.
Expected behavior: I am able to scroll the image both vertically and horizontally.
Actual behavior: I am able to scroll the image only horizontally.

@usa- usa- changed the title <ScrollView Orientation="Both"> not working Vertical scrolling in <ScrollView Orientation="Both"> not working Jun 7, 2022
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jun 7, 2022
@flipper09112
Copy link

flipper09112 commented Aug 31, 2022

Some deadline for this fix? Some workarround?

@xtuzy
Copy link

xtuzy commented Sep 5, 2022

Today i also find it, dont' work at Android, work at Windows.

sharex-20220905092632.mp4

@ycaktirma
Copy link

I encountered this issue when trying to present tabular data in my application. I had to use ScrollView with Orientation property set to "Both" (So users can see the all data).
It didn't work. I found a temporary solution. You can't scroll diagonally but vertical and horizontal scrolls are working fine. Instead of creating one ScrollView and set its Orientation to "Both", we will create two of them. One is responsible for vertical scrolls and the other one is for horizontal scrolls.

  1. Create a ScrollView and set its Orientation to Vertical.
  2. Create a ScrollView and set its Orientation to Horizontal
  3. Set horizontal ScrollView's parent to vertical one. (If you set verticals parent to horizontal, it won't work. I don't know why.)

I am developing the UI without XAML. So I can only give an example in C#.

var scrY = new ScrollView();
scrY.Orientation = ScrollOrientation.Vertical;

var scrX = new ScrollView();
scrX.Orientation = ScrollOrientation.Horizontal;

scrX.Parent = scrY;
scrY.Content = scrX;

var table = new VerticalStackLayout();
table.Parent = scrY;
scrX.Content = table;

I am using VerticalStackLayout as content.

I didn't test it using XAML but i guess it will be okay.

Note: I only tested in Android Emulator. Idk if it is working on windows or ios or any other platform.

scrollViewTest.mp4

@hartez hartez added the area-controls-scrollview ScrollView label Oct 9, 2022
@tranb3r
Copy link

tranb3r commented Nov 16, 2022

Any update ?

@usa-
Copy link
Author

usa- commented Nov 17, 2022

I doubt that there will be any :) I have moved my project to Android Studio / Kotlin, so now I know, that MAUI controls are wrappers around native Android controls with the same names, and the Android's ScrollView ir the one having the issue. If the developers of MAUI create a workaround using a combination of another controls, it will have another issues for sure.

@tranb3r
Copy link

tranb3r commented Nov 17, 2022

I doubt that there will be any :) I have moved my project to Android Studio / Kotlin, so now I know, that MAUI controls are wrappers around native Android controls with the same names, and the Android's ScrollView ir the one having the issue. If the developers of MAUI create a workaround using a combination of another controls, it will have another issues for sure.

But it works in xamarin forms, so surely it can be fixed in maui...

@xiaoyuvax
Copy link

I doubt that there will be any :) I have moved my project to Android Studio / Kotlin, so now I know, that MAUI controls are wrappers around native Android controls with the same names, and the Android's ScrollView ir the one having the issue. If the developers of MAUI create a workaround using a combination of another controls, it will have another issues for sure.

met the same problme, but what is that "workaround"?
@usa-

@rmarinho rmarinho self-assigned this Mar 1, 2023
@rmarinho rmarinho moved this from Todo to In Progress in MAUI SDK Ongoing Mar 1, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in MAUI SDK Ongoing Mar 8, 2023
@samhouts samhouts added this to the .NET 8 Planning milestone Mar 17, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! label Apr 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 12, 2023
@Eilon Eilon removed the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants