Iphone 单击按钮时如何显示文本字段

Iphone 单击按钮时如何显示文本字段,iphone,uitextfield,Iphone,Uitextfield,可能重复: 我想显示UITextField,当单击按钮时该字段将变得可编辑。 如果有人知道,请给我答案。为UIButton创建一个iAction,如下所示: -(IBAction)showTextFied:(id)sender{ yourTextField.editable=YES;//turn to editable mode if it's not [yourTextField becomeFirstReponder];//show the keyboard } 你想在同一

可能重复:

我想显示UITextField,当单击按钮时该字段将变得可编辑。
如果有人知道,请给我答案。

为UIButton创建一个iAction,如下所示:

-(IBAction)showTextFied:(id)sender{
    yourTextField.editable=YES;//turn to editable mode if it's not
   [yourTextField becomeFirstReponder];//show the keyboard
}

你想在同一个uiview上显示它吗?不客气。如果答案有用,记得接受它。请记住,你应该使用谷歌(或搜索引擎)来找到这类问题的解决方案…并阅读文档..干杯