question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VerticalStackLayout inside Scrollview: Button at the bottom not clickable on IOS

See original GitHub issue

Description

When you put a VerticalStackLayout inside a ScrollView and load some data dynamically (i.e. some Text using an async function) and then put a button on the end of the VerticalStackLayout, the Button-Handler never gets called. This works on Android without any problem. For me related to: #8820

Steps to Reproduce

  1. Clone the repo
  2. Run the app on IOS
  3. Click on the “Button at bottom” Button
  4. Scroll to the bottom of the page and try to click the button

Link to public reproduction project repository

https://github.com/FM1973/RefreshGridRepo.git

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 14.x +

Did you find any workaround?

Yes, there is a workaround. It´s the same as before having the general ScrollView-problem stated in #8820 Look there: https://github.com/dotnet/maui/issues/8820#issuecomment-1352923013

Relevant log output

-

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Reactions:5
  • Comments:35 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
jadenrogerscommented, May 31, 2023

@hartez Please correct me if I am wrong but when you say “This is fixed by https://github.com/dotnet/maui/pull/14176.” can people on .net 7 expect these fixes? As .net 8 isn’t released is it fair to say these are fixed. Running into this a lot where issues are raised in current .net 7 and fixed for .net 8 which is a little frustrating.

Maybe we could avoid using “its fixed”, until a PR is raised against .net 7. I feel I am going to have to upgrade to .net 8 to get all these fixes but then is it the same again when we encounter problems… Fixed in .net 9 Preview X?

Thanks

4reactions
nicjaycommented, May 3, 2023

The InvalidateMeasure workaround does still work for me as of 7.0.81 for this particular issue.

To be clear, I use code similar to the following in my code-behind:

MyVerticalStackLayout.SizeChanged += (object sender, EventArgs e) =>
{
    (MyScrollView as IView).InvalidateMeasure();
}

XAML

<ScrollView x:Name="MyScrollView">
    <VerticalStackLayout x:Name="MyVerticalStackLayout">
    ...
    </VerticalStackLayout>
</ScrollView>

However, it would be ideal if this were not necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Button can't be clicked in iOS and MacCatalyst where is ...
1 Answer 1 · Fixed in .Net 8 Preview: iOS ScrollView ContentSize (content beyond screen). · That also fixes Button at the bottom...
Read more >
IOS ScrollView add children views ,bottom button will out of ...
IOS ScrollView add children views ,bottom button will out of screen,then scroll back to screen, but button will not work?
Read more >
Maui nested Scrollview does not scroll : r/dotnetMAUI
Today's challenge is figuring out why the Scrollview is not working as expected. It not only does not work as it did in...
Read more >
Margin not working with ScrollView - Microsoft Q&A
But the Button hiding behind the ScrollView and no matter how much I set the Bottom Margin o f the ScrollView it will...
Read more >
Button not working in UIScrollView | Apple Developer Forums
I have button inside a view inside a scroll view. The button does not work. How can I get the button to work?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found