ios - Xamarin ios 隐藏\删除 UIPickerView

标签 ios xamarin uipickerview show-hide

我创建了一个带有“完成”按钮的自定义 UIPickerView,但我无法将其从屏幕上删除。 这是创建 UIPickerView 的结果: enter image description here

我尝试使用这个功能:

public void removeAll(UIPickerView picker){
  this.toolbar.RemoveFromSuperview ();
  picker.RemoveFromSuperview ();
}

但结果是:enter image description here

最佳答案

解决方式:

public void removeAll(UIPickerView picker){
  this.toolbar.RemoveFromSuperview ();
  picker.Layer.Opacity = 0f;
  picker.Layer.Bounds = new  RectangleF(0,0,0,0);
  picker.RemoveFromSuperview ();
}

关于ios - Xamarin ios 隐藏\删除 UIPickerView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23673213/

相关文章:

c# - Xamarin iOS - Mapkit ArgumentNullException : Value cannot be null

ios - 使用 UITextView 占位符并且在重新输入时不清除文本

ios - 字典中数组的索引错误(Swift 3.0)

ios - 没有互联网连接时禁用按钮

c# - iOS 运行错误 s Xamarin Live Player 和 Hanselman.Forms

ios - 将所选值放入文本字​​段中

ios - CoreData iCloud 更改未保存

c# - 从 3.4 alpha 升级到 Microsoft.IdentityModel.Clients.ActiveDirectory 3.10

ios - 将 UIPickerView 视为组合/选择框

ios - UIPickerView - 循环数据