Last active
August 29, 2015 14:12
-
-
Save pisarukv/89c59caf15e7436f261e to your computer and use it in GitHub Desktop.
This file contains 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
Xamarin Studio | |
Version 5.7 (build 660) | |
Xamarin.iOS | |
Version: 8.6.0.41 (Enterprise Edition) | |
#1 ViewRenderer Problem | |
//.... Dont work correctly. When happenning dispose ViewRendere can't find control and throw NullReferenceException | |
override void OnElementChanged(ElementChangedEventArgs<View> e) | |
{ | |
base.OnElementChanged(e); | |
} | |
//.... | |
//.... Partial solution, it's work, but if you have subviews with gestures this code won't work correctly | |
override void OnElementChanged(ElementChangedEventArgs<View> e) | |
{ | |
base.OnElementChanged(e); | |
if (e.OldElement == null) | |
{ | |
SetNativeControl(new UIView()); | |
} | |
} | |
//.... | |
//.... Probably right solution | |
override void OnElementChanged(ElementChangedEventArgs<View> e) | |
{ | |
base.OnElementChanged(e); | |
if (e.OldElement == null) | |
{ | |
var view = new UIView(); | |
view.AddSubviews(Subviews); | |
SetNativeControl(view); | |
} | |
} | |
//.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment