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

Controls/Layout does not draw controls correctly in first-time view. #4672

Open
mobycorp opened this issue Feb 14, 2022 · 15 comments
Open

Controls/Layout does not draw controls correctly in first-time view. #4672

mobycorp opened this issue Feb 14, 2022 · 15 comments
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/windows 🪟 s/triaged Issue has been reviewed t/bug Something isn't working
Milestone

Comments

@mobycorp
Copy link

Description

I am writing a POC MAUI app and feel this behavior is a bug.

In my app, I have created a desktop shell which is basically copied from the Podcasts example code. My app has four pages with some text and frames. When I run the app and view a page for the first time, the controls are not drawn properly. Alignment is off. Margins are incorrect. The page looks like a mess. If I go to another page and return to the previous page, the layout is drawn correctly.

One thing I observed is that this behavior only exists if the layout is contained within a Frame. I was testing a MAUI control from Syncfusion and it drew correctly the first time through when the control was not wrapped inside a frame. When I added the frame around the control, it did NOT draw correctly. I first thought this may be an issue with the Syncfusion control itself, but then on another page, I had a frame that simply contained two labels. The text was all incorrectly drawn on the first visit to the page, but then drawn correctly on the second visit so I am taking Syncfusion off the hook. I am pretty certain it has something to do with the way the Frame performs its layout calculations. Also, when I resized the window, the layout is recalculated on the size event, and it draws correctly.

Here are some example screenshots:

First time in with frame
First time in with frame

Second time in with frame
Return to page with frame

First time in with no frame
First time in with no frame

Steps to Reproduce

  1. Create an app with two pages in the shell's flyout layout
  2. Create a page with a frame
  3. Add some simple controls such as a label inside the frame
  4. Run the program and observe the layout - It should be incorrectly drawn
  5. Switch to the other page and then return to the first page - it will be correctly drawn
  6. The same behavior is exhibited when the first page is shown and you simply resize the window.

Version with bug

Preview 12 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

net6.0-windows10.0.19041, net6.0-andriod... I did not test with my iPhone, but my guess is the same behavior will be exhibited there...

Did you find any workaround?

No.

Relevant log output

N/A
@mobycorp mobycorp added the t/bug Something isn't working label Feb 14, 2022
@mobycorp
Copy link
Author

I thought I should include two more screen shots. These show a simple page with some frames within a frame...

Screenshot 2022-02-14 092432
Before resize

Screenshot 2022-02-14 092501
After resize

There is no magic here - just some simple XAML...

@jsuarezruiz jsuarezruiz added platform/windows 🪟 area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fatal labels Feb 15, 2022
@mobycorp
Copy link
Author

mobycorp commented Feb 17, 2022

@jsuarezruiz - This seems to have been fixed in preview 13 as my pages render correctly now. I could close this issue, but I wanted the MAUI team to see this...

@davidortinau
Copy link
Contributor

Thanks Steve. It may be fixed for you, but we certainly have more work to do here. This is the first run screen of the WeatherTwentyOne app for Windows.

image

  • The Flyout is not sized to the width provided
  • The Border controls in the right widget panel are not drawing the background

Resizing the window does NOT fix it. I have to navigate away and back. Then I see:

image

Now I can see that the Border controls in the right panel are cut off on the right side. Frame worked, but Border is the problem here.

https://github.com/davidortinau/WeatherTwentyOne/blob/main/src/WeatherTwentyOne/Views/WidgetsPanel.xaml#L8-L41

@davidortinau
Copy link
Contributor

The Border cropping issue seems to be related to sizing that doesn't account for the Collection GridItemsLayout HorizontalItemSpacing and VerticalItemSpacing. @hartez

@mobycorp
Copy link
Author

mobycorp commented Feb 18, 2022 via email

@Fabi
Copy link

Fabi commented Feb 28, 2022

Any news regarding that?

@wenwen60
Copy link

wenwen60 commented Mar 1, 2022

Reproduce on windows using VS2022 17.2.0 Preview 2.0[32215.517.main], attach repro sample
4672.zip.

@wenwen60 wenwen60 added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Mar 1, 2022
@MaxtorCoder
Copy link

Any news regarding this issue?

@hartez hartez self-assigned this Mar 8, 2022
@hartez hartez added this to the 6.0.300-servicing milestone Mar 22, 2022
@samhouts
Copy link
Member

On 6.0.400-preview.1.5782, the Flyout is sized properly, but I still see cropping on the Border (see #4672 (comment)).

@hartez hartez removed the fatal label Jun 27, 2022
@hartez hartez removed their assignment Aug 2, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 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.

@samhouts samhouts removed the s/verified Verified / Reproducible Issue ready for Engineering Triage label Apr 5, 2023
@jinxinjuan jinxinjuan added the s/triaged Issue has been reviewed label Apr 25, 2023
@mobynet1
Copy link

I reported this issue a year and a half ago and it is still an issue. Now, I am seeing this with the flyout menu. First time in, the flyout menu items are not spaced correctly and then when you tweak the width of the overall window, things are drawn correctly.

First time in:
Screenshot 2023-09-15 110039

Pull on an edge to resize the window:
Screenshot 2023-09-15 110112

As I said, I reported this a LOOONG time ago and nothing has been done. In fact, it looks like the cancer is spreading. How are we supposed to develop world-class applications using MAUI when they don't render correctly and basically look like crap.

@darkBuddha

This comment was marked as off-topic.

@erikbloodshed
Copy link

Don't use this framework. Microsoft is getting all it's developer to focus on the cloud and its AI bullshits! This project is dead already. Thank you.

@Fabi
Copy link

Fabi commented May 20, 2024

Still broken yay

@jeremy-visionaid
Copy link
Contributor

Yeah, this one has been bugging me for years too... Still present in net9.0 / 9.0.10 SR1 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/windows 🪟 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests