且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

选择UITextField时如何显示UIPickerView

更新时间:2023-12-04 12:30:46

它将为您工作..我已经对其进行了编辑.为此,您必须为文本字段设置委托.并在NIb文件中创建UIPIckrView.

it will work for you .. i have edited it .and for that you have to set delegate for textfield. and create a UIPIckrView in NIb file.

- (BOOL) textFieldShouldBeginEditing:(UITextView *)textView
{
    pickrView.frame = CGRectMake(0, 500, pickrView.frame.size.width,    pickrView.frame.size.height);
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:.50];
    [UIView setAnimationDelegate:self];
    pickrView.frame = CGRectMake(0, 200, pickrView.frame.size.width, pickrView.frame.size.height);
    [self.view addSubview:pickrView];
    [UIView commitAnimations];
    return NO;
}