4

Is there an easy way to hide the scrollbar in a ListView, but still leave it scrollable?

2 Answers 2

9

You can make a custom ListView renderers for each platform (http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/):

On Android:

ListView.VericalScrollbarEnabled = false;

On iOS:

UIScrollView.ShowsVerticalScrollIndicator = false;
Sign up to request clarification or add additional context in comments.

5 Comments

Thanks! One more thing - can I change the color of the separator between the listview items and if yes what is the name of the property?
No problem. iOS: UIScrollView.SeparatorColor, Android: ListView(this).Divider = new ColorDrawable(Android.Graphics.Color.Blue); ListView.DividerHeight(1);
As for your question about separator color (comments above) in ListView - Xamarin team recommend to use build-in bindable property SeparatorColor.
You can also do this by using an effect. This way you don't need to create a complete customer renderer for scrollviews. The effect can set the same properties as in this answer
Hi, I am try to write custom renderer for hide scrollbar in listview. I am try to write above line in andorid 'onelementchanged' property but not luck. Please suggest where can i write this line for getting hide the scrollbar in listview in both andorid and ios in xamarin.
2

You just need to provide VerticalScrollBarVisibility="Never" in your xaml.

<ListView x:Name="lst"  VerticalScrollBarVisibility="Never">
</ListView>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.