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

ScrollView doesn't center its content. #11315

Open
dg2k opened this issue Nov 12, 2022 · 5 comments
Open

ScrollView doesn't center its content. #11315

dg2k opened this issue Nov 12, 2022 · 5 comments
Labels
area-controls-scrollview ScrollView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@dg2k
Copy link

dg2k commented Nov 12, 2022

Description

I upgraded my Maui app from net6.0 to net7.0 and having an issue with ScrollView as it doesn't center its content anymore. I use Grid layout to position Labels and Button and ScrollView is used for vertical scrolling. With ScrollView XAML commented out, the view rendering is perfect as it should be.

It works fine on Windows and the issue is on Android. I haven't tested on other platforms.

UPDATE: There is a minor issue with WinUI as well -- if Margin and/or Padding attributes are added to StackLayout containing an Image, the layout gets distorted. The uploaded Demo will explain this clearly with added comment.

Steps to Reproduce

  1. Create Grid Layout and position some Labels and Button(s) controls to show as centered.
  2. Add the Grid to ScrollView control.

Link to public reproduction project repository

https://github.com/dg2k/MauiDemoScrollView

Version with bug

7.0 (current)

Last version that worked well

6.0.424

Affected platforms

Android

Affected platform versions

Android 11 and Android 12

Did you find any workaround?

No.

Relevant log output

No response

@dg2k dg2k added the t/bug Something isn't working label Nov 12, 2022
@jsuarezruiz jsuarezruiz added area-controls-scrollview ScrollView platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue labels Nov 14, 2022
@ghost
Copy link

ghost commented Nov 14, 2022

Hi @dg2k. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Nov 14, 2022
@dg2k
Copy link
Author

dg2k commented Nov 15, 2022

Updated with a link to a publicly accessible GitHub demo project.
The project, when running, shows explanatory notes. The same comment text is in MainPage.xaml.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Nov 15, 2022
@jsuarezruiz jsuarezruiz removed the s/needs-attention Issue has more information and needs another look label Nov 15, 2022
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Nov 15, 2022
@ghost
Copy link

ghost commented Nov 15, 2022

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.

@Zhanglirong-Winnie Zhanglirong-Winnie added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels May 31, 2023
@Zhanglirong-Winnie
Copy link
Collaborator

Verified this issue with Visual Studio 17.7.0 Preview 1.0. Can repro on android platform with sample project.
MauiDemoScrollView-master.zip
11315 A

@Shujee
Copy link

Shujee commented Apr 23, 2024

Is there a workaround for this? Facing it in my project that I'm trying to port from WPF to MAUI.

@Eilon Eilon removed the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-scrollview ScrollView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants