2014-05-15 151 views
0

我用「完成」按鈕創建了一個自定義的UIPickerView,但我無法從屏幕上刪除它。 這是UIPickerView的創建結果: enter image description hereXamarin ios隱藏刪除UIPickerView

我已經嘗試使用此功能:

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

但結果是:enter image description here

+0

解決: public void removeAll(UIPickerView選擇器){ \t this.toolbar.RemoveFromSuperview(); \t picker.Layer.Opacity = 0f; \t picker.Layer.Bounds = new RectangleF(0,0,0,0); \t picker.RemoveFromSuperview(); } – Hikari

回答

1

與解決:

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