void OnRemoveSubviews(object sender, EventArgs e) { if (parentView != null) { parentView.RemoveFromSuperview(); parentView = null; } }
void OnRemoveSubviews(object sender, EventArgs e) { if (parentView != null) { parentView.RemoveFromSuperview(); // This fixes the problem - 1st approach //parentView.Dispose (); parentView = null; } }
void OnAddSubviews(object sender, EventArgs e) { if (this.parentView != null) { return; } parentView = new CustomParentView { BackgroundColor = UIColor.Yellow, Frame = new CGRect(0, 0, 200, 200), Center = this.View.Center }; Add(parentView); }