Forum Xamarin Xamarin.Forms

ScrollView allow content overflow

AlexRutherfordAlexRutherford GBUniversity ✭✭
edited October 2017 in Xamarin.Forms


I am trying to allow a scrollview to overflow (not clip its children). I have this working with a carousel view but cannot get the same result with a scrollview. I have it working on iOS but not Android (this is about android).

The idea of this is to center the scrollview and allow overflow so the content can look centered (being used as tabs).


Use of the scrollview in Xamarin Forms:

 var scrollView = new ScrollView
    WidthRequest = 200,
    HorizontalOptions = LayoutOptions.Center,
    Orientation = ScrollOrientation.Horizontal,
    Content = scrollViewContent,
    IsClippedToBounds = false

This is my custom renderer for the scrollview (Android):

public class CenteredScrollViewRenderer : ScrollViewRenderer
    protected override void OnElementChanged(VisualElementChangedEventArgs e)

        if (e.OldElement != null || this.Element == null)

        if (e.OldElement != null)
            e.OldElement.PropertyChanged -= OnElementPropertyChanged;

        e.NewElement.PropertyChanged += OnElementPropertyChanged;


    protected void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)

        if (ChildCount > 0)
            GetChildAt(0).HorizontalScrollBarEnabled = false;
            GetChildAt(0).VerticalScrollBarEnabled = false;
            GetChildAt(0).OverScrollMode = OverScrollMode.Never;

            // Try and disable clip

Other attempts

I have also created a function to go through ALL parents to disable clipping just to see if it was a parent causing a problem. This still has not worked.

So how to we allow the scrollview content to overflow outside of its bounds?

Note: This is on stackoverflow too:


Sign In or Register to comment.