模式视图 键盘消失 问题

   if(starttextfield==nil){

            starttextfield=[[UITextFieldalloc]initWithFrame:CGRectMake(0, 0, 10, 10)];

            }

           

            starttextfield.backgroundColor=[UIColorredColor];

            UIView* viewTemp1 = [[UIView alloc]init];

            viewTemp1.backgroundColor=[UIColorclearColor];

            starttextfield.inputView=viewTemp1;

            [self.view addSubview:starttextfield];

            [viewTemp1 release];

            

            [starttextfieldbecomeFirstResponder];

 

// 必须要设置 inputView 之后 将textField设置为第一响应者 才可以

原文地址:https://www.cnblogs.com/zander/p/2684482.html