car*_*ean 4 objective-c uidatepicker xcode4.5
我在我的XIB文件中有一个UITextField和一个UIDatePicker,现在我分配了选择的日期UIDatePicker作为我的文本字段中文本的值.我做得很好,我现在唯一的问题是,当我点击文本字段时,我希望键盘不显示.我确定有人知道答案,如果你愿意分享,我会很高兴:)谢谢!
顺便说一句.我尝试过这个,但它不起作用..
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
[textField resignFirstResponder];
}
Run Code Online (Sandbox Code Playgroud)
rck*_*nes 12
Just set the UIDatePicker as the inputView of your UITextField.
This wil repalce the keyboard as the input view when the user clicks on the UItextField with the UIDatePicker.
self.dateTextField.inputView = self.datePicker;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6841 次 |
| 最近记录: |