Tag: uitextfield

IOS:使用iPad KeyBoard的回车键进行操作

我有两个文本框,在第一个文本框中我写“Hello”,当我按下iPad键盘input时,我希望在第二个文本框中出现“世界”; 我如何使用回车在我的应用程序中创build一个动作?

Swift在UITextField中添加图标/图像

我想在UITextField中添加图标/图像。 图标/图像应留给占位符。 我试过这个: var imageView = UIImageView(); var image = UIImage(named: "email.png"); imageView.image = image; emailField.leftView = imageView; 谢谢。

iPhone强制文本框input大写

我如何强制input到iPhone上的文本框的字符大写?

如果用户点击屏幕键盘,我怎样才能closures键盘?

我希望能够在用户点击键盘外的任何地方时closuresiPhone键盘。 我怎么能这样做? 我知道我需要closures响应者,但是当用户敲击键盘空间时需要知道如何实现它。

UITextField -webView不再受支持

处理一些文本字段时,我得到下面的debugging输出。 调用UITextField -webView。 新的文本体系结构不再支持此方法 有人可以解释为什么这是出现? 我目前正在使用iOS 7运行XCode 5

具有自定义字体的UITextField secureTextEntry项目符号?

我在UITextField使用了一个自定义字体,它已经打开了secureTextEntry 。 当我在单元格中input内容时,我看到了所选字体中的子弹,但是当该字段失去焦点时,这些子弹将恢复为系统标准字体。 如果我再次点击该字段,它们会变回我的字体,依此类推。 有没有一种方法可以确保他们继续显示自定义字体的项目符号,即使该字段没有对焦?

如何将焦点设置到iPhone中的文本字段?

你如何编程将焦点设置为iPhone中的某些文本字段作为按下文本字段的结果?

如何将TextField添加到Swift中的UIAlertController

我想显示一个UITextView的UIAlertController。 当我添加该行时: //Add text field alertController.addTextFieldWithConfigurationHandler { (textField) -> Void in } 我得到一个运行时错误: 致命错误:意外地发现零,而解包一个可选的值 let alertController: UIAlertController = UIAlertController(title: "Find image", message: "Search for image", preferredStyle: .Alert) //cancel button let cancelAction: UIAlertAction = UIAlertAction(title: "Cancel", style: .Cancel) { action -> Void in //cancel code } alertController.addAction(cancelAction) //Create an optional action let nextAction: UIAlertAction = UIAlertAction(title: […]

简单的方法来禁用UITextField?

有没有简单的方法来禁用代码中的UITextField ? 我的应用程序有12个UITextField ,默认情况下都是打开的,但是当我在段控制中检测到更改时,我想根据用户select哪个段来禁用某些UITextField 。 只需要知道如何禁用它或使其不可编辑? 谢谢

更改UITextField占位符字体

我正在改变占位符的文字颜色与下面的代码,但是当我尝试添加NSFontAttribute我得到编译器错误"too many arguments to method call, expect 2 have 3" UIColor *color = [UIColor blackColor]; _nameField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"Your Name" attributes:@{NSForegroundColorAttributeName: color},@{NSFontAttributeName:@"Roboto-Bold"}]; 这工作正常: UIColor *color = [UIColor blackColor]; _nameField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"Your Name" attributes:@{NSForegroundColorAttributeName: color}];