Maui: MAUI iOS - DrawingView inside ScrollView does not draw. Attempted drawing trigger scrolling instead of drawing. (works fine on android)

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the “Reporting a bug” section on Contributing file?

Current Behavior

When DrawingView is used inside scroll view, attempt to draw triggers scrolling on iOS and drawing does not work. this works fine on android.

I am trying to migrate Xamarin Forms app to MAUI and need to replace signature pad on the form with drawing view. this is a blocker for my migration.

Expected Behavior

DrawingView inside scroll view must work fine on iOS like android. Drawing must not trigger scrolling.

Steps To Reproduce

I have provided link to reproduction repository and video with demo app.

Steps: (problem only on iOS, android works fine)

Create Default MAUI App Add community toolkit to use drawing view Updated MauiProgram.cs and add .UseMauiCommunityToolkit() to builder. Update main page xaml to have drawing view inside scroll view, make sure there is enough content before and after drawing view to have scroll bar on the page try to draw on drawing view (vertically), page scrolls instead of drawing on drawing view.

https://github.com/CommunityToolkit/Maui/assets/11797119/bfee73bf-5a94-46be-aa5c-58c9062398d6

Link to public reproduction project repository

https://github.com/mahesh139/MAUIDrawingView

Environment

- .NET MAUI CommunityToolkit:8.0.1
- OS:Windows 10
- .NET MAUI:8.0.7

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@mnidhk FYI, I’ve wrote a blog post with an explanation of a possible solution for this problem, for ScrollView and TableView.

https://medium.com/medialesson/how-to-use-a-drawingview-inside-a-scrollable-layout-in-net-maui-2a080e32cdb4

Thanks @zleao ios:ScrollView.ShouldDelayContentTouches=“false” works fine.

@zleao thank you for sharing that! I think we should add that detail to the documentation for the toolkit and that might be all we can do for now.

I solved this problem, by addding the ios:ScrollView.ShouldDelayContentTouches="false" to the ScrollView that contains the DrawingView:

<ContentView
...
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls">

    <ContentView.Content>
        
        <ScrollView ios:ScrollView.ShouldDelayContentTouches="false">
...

more info here: https://learn.microsoft.com/en-us/dotnet/maui/ios/platform-specifics/scrollview-content-touches?view=net-maui-8.0