Is there a way to compensate for the scroll bar on UWP

RaymondKellyRaymondKelly ✭✭✭USMember ✭✭✭

I have a list view that is marked as fill and expand with content aligned to the right. When the scroll bar is shown, it covers up the listview and content. Is there a property or some recommended way to compensate for the scroll bar?

Tagged:

Best Answer

Answers

  • RaymondKellyRaymondKelly ✭✭✭ USMember ✭✭✭

    Ok, so I guess for now we just need to add some padding. Thanks!

  • JohnHardmanJohnHardman mod GBUniversity mod

    @RaymondKelly - Unfortunately, the bug is still outstanding more than 18 months later. I did the padding as a temporary (but not very nice) workaround. Did you by any chance work out how to change the opacity/transparency of the UWP scroll bar without the change affecting the rest of the ScrollViewer?

  • JohnHardmanJohnHardman mod GBUniversity mod
    edited April 13

    @RaymondKelly - Three years late, I know ;-)

    To identify whether the scroll bar is currently visible on UWP, I ended up subclassing Xamarin.Forms.ScrollView and adding a custom ScrollView renderer to operate on that subclass.

    The native control on UWP for the ScrollView is the ScrollViewer.
    This has ComputedVerticalScrollBarVisibility and ComputedHorizontalScrollBarVisibility properties, which I compare with Visibility.Visible.
    I then set boolean properties in the ScrollView subclass to indicate whether the scroll bars are visible or not.
    Via a PropertyChanged event, the page containing the subclassed ScrollView then dynamically changes the Margin of the View that is the Content of the ScrollView subclass.

Sign In or Register to comment.