0

I have written a custom scrollBar in native android. I was able to display the scroll bar in native Android there by setting the below code in the layout.xml file.

android:scrollbars="horizontal|vertical"

Now I am porting that to Xamarin.Android. Everything is fine except the scroll bar. How can I display the scroll bar here in Xamarin.Android. Any one having idea on how to do this in code behind?

I tried setting the View.HorizontalScrollBarEnabled and View.VerticalScrollBarEnabled properties in my CustomScrollView constructor. Also have tried overriding the properties and made it true always. But it didnt work for me. I have written my CustomScrollViewer extending from FrameLayout. What am I doing wrong? Or Is there any other way?

Harikrishnan
  • 1,474
  • 2
  • 11
  • 25

1 Answers1

0

The attribute comes from android.view.View and is also accessible through setHorizontalScrollBarEnabled and setVerticalScrollBarEnabled.

These two methods are translated into properties in Xamarin.Android called HorizontalScrollBarEnabled and VerticalScrollBarEnabled.

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
  • I have already tried this. I tried setting these propertied in my CustomScrollView constructor. Also have tried overriding the property and made it true always. But it didnt work for me. I have written my CustomScrollViewer extending from FrameLayout. What am I doing wrong? Or Is there any other way? – Harikrishnan Jul 15 '15 at 17:27