如何在键盘上方添加工具栏?
我已经以UIToolBar编程方式创建并添加了一个UITextField。现在,当我单击另一个文本字段时,我需要该工具栏位于键盘上方。 UIToolbar *toolBar=[[UIToolbar alloc]initWithFrame:CGRectMake(0,400, 320, 60)]; [self.view addSubview:toolBar]; UITextField *txtView=[[UITextField alloc]initWithFrame:CGRectMake(0, 400, 260, 30)]; txtView.backgroundColor =[UIColor grayColor]; txtView.placeholder=@"Address"; UIBarButtonItem *txtfieldItem=[[UIBarButtonItem alloc]initWithCustomView:txtView]; toolBar.items =[NSArray arrayWithObject:txtfieldItem];