2013-11-21 133 views

回答

3

當您將UITextField的inputView值設置爲指向選擇器時,該選擇器將在有人選擇該UITextField時加載。確保先配置你的選擇器,然後設置你的UITextField的inputView值,如下面的代碼所示。現在iOS會處理所有其他事情,並確保顯示選擇器。

UIPickerView *myPickerView = [[UIPickerView alloc] init]; 
//myPickerView configuration here... 
myTextField.inputView = myPickerView; 

this link

+0

可能發生什麼一點解釋,但這是正確的解決方案。 – ophychius

相關問題