Created
January 10, 2018 20:37
-
-
Save rdelrosario/6c7b5953c2bb7471555d9930089e219a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using SegmentedControlSample.Controls; | |
using SegmentedControlSample.Droid.Renderers; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
[assembly: ExportRenderer(typeof(ScrollViewWithNotBar),typeof(ScrollViewWithNotBarRenderer))] | |
namespace SegmentedControlSample.Droid.Renderers | |
{ | |
public class ScrollViewWithNotBarRenderer : 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) | |
{ | |
this.HorizontalScrollBarEnabled = false; | |
this.VerticalScrollBarEnabled = false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment