[assembly: ExportRenderer(typeof(ScrollView), typeof(App3.Droid.Scrollbardisabledrenderer))]
namespace App3.Droid
{
public class Scrollbardisabledrenderer : ScrollViewRenderer
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
if (e.OldElement != null || this.Element == null)
return;
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;
}
}
}
}
This is what i have done so far used this renderer in .droid , but when i run it in a simulator using a scroll view with simple boxes as children of a grid the scroll bar is visible , i am getting no errors while build . Is there something im missing in the procedure of custom renderers ? im new to coding all together have a basic understanding of c# and xaml please help me out with this advance topic