Customize scrollbar in Xamarin.Forms with GrialKIT UI using a repeater

18 Views Asked by At

Im using the GrialKIT UI to render elements in my application. On iOS the scrollbar is thin and looks nice. However, on android the scrollbar seems to default to Native rendering so the scrollbar is quite thick.

This is the code for the repeater.

I have tried creating a custom stylesheet. Using that, i can change the background but when i try to customize the scrollbar with ::-webkit-scrollbar the app crashes. It seems like Xamarin.Forms does not support this.

            <grial:Repeater
                StyleClass="test"
                VerticalOptions="Center"
                HorizontalOptions="Center"
        Grid.Row="1"
        ScrollPadding="0,0,0,29"
                Margin="0,0,0,0"
        ItemsSource="{ Binding MyModel}"
        ScrollBarVisibility="Always"                   
        Spacing="10">
                
                <grial:Repeater.ItemSize>
                    <OnIdiom             
            x:TypeArguments="x:Double"
            Phone="111"
            Tablet="162" />
                </grial:Repeater.ItemSize>

                <grial:Repeater.ItemTemplate>
                    <DataTemplate>
                        <local:SectionItemTemplate />
                    </DataTemplate>
                </grial:Repeater.ItemTemplate>

            </grial:Repeater>

The documentation on Grial is quite sparse, and the only mentioning about thickness is ScrollPadding but is only seems to add padding instead of adjusting the thickness of the scrollbar.

0

There are 0 best solutions below