MAUIverse MAUIverse

.NET MAUI: Disable Scrolling on Android

While building a drag and drop component, Jean-Marie Alfonsi needed to freeze a parent ScrollView for a moment. Setting IsEnabled = false had no effect, and the MAUI source explained why: ScrollViewHandler maps IsEnabled only under #if __IOS__.

On Android, the usual route is overriding touch handling, which Xamarin.Forms developers did in a custom renderer. The MAUI equivalent is a handler. The post shows a ScrollViewEnableHandler plus a MauiScrollViewEnable subclass of MauiScrollView that returns false from OnInterceptTouchEvent and OnTouchEvent when disabled, then registers it in MauiProgram.cs under #if ANDROID.

It also links the dotnet/maui issue to follow, and notes that once it’s resolved you’ll be able to use Orientation="Neither" instead.

View Source →

← Back to Community Feed

}