Tag: uitextinput

UITextField忽略inputDelegate‽

UITextField是否忽略了inputDelegate? 使用下面的代码: – (void)viewDidLoad { [super viewDidLoad]; self.textField.inputDelegate = self; NSLog(@"textField: %@", self.textField); NSLog(@"delegate: %@", self.textField.inputDelegate); } 我得到以下输出: 2012-03-26 20:43:49.560 InputTest[33617:f803] textField: <UITextField: 0x6c093a0; frame = (20 20; 280 31); text = ''; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x6c094d0>> 2012-03-26 20:43:49.561 InputTest[33617:f803] delegate: (null) 它运行得很好,没有任何警告或exception,委托属性工作得很好。 但是,设置inputDelegate不会导致更改,并且不会调用委托方法。

MonkeyTalk无法识别UITextfieldinput事件

我正在使用Monkeytalk v1.0.62及其在UIAlertview中不识别textfieldinput事件。 如果我在文本框内键入任何文本,则在录制或回放时不显示任何内容。 它似乎像monkeytalk不会识别UITextfieldinput或做到这一点?

使用听写 – iOS 6 – DidStart?

如何回应开始听写? 已知的听写方式: dictationRecordingDidEnd – 响应已完成的口述短语的识别。 dictationRecognitionFailed – 回应失败的听写识别。 参考: UITextInput协议参考 从iOS 5.1开始,当用户在支持的设备上select听写input时,系统会自动将已识别的短语插入到当前的文本视图中。 UITextInput协议中的方法允许您的应用程序响应听写的完成,如“使用听写”中所述。您可以使用UIDictationPhrase类的对象来获取表示用户已经声明的短语的string。 在不明确的听写结果的情况下,听写短语对象提供包含替代string的数组。 http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInput_Protocol/Reference/Reference.html

UITextInputMode.activeInputModes()在Swift 2中崩溃

我想在Swift 2中得到UITextInputMode,但UITextInputMode.activeInputModes()崩溃。 let x = UITextInputMode.activeInputModes() // crash here for t in x { print(t) }

添加取消button到UITextField键盘

有没有办法添加一个取消button显示为UITextField的键盘? 查看UITextInputTraits协议参考,我找不到任何东西,包括尝试不同的键盘types。

UITextField开始听写

我想以编程方式把我的UITextFieldinput到听写模式,而不需要用户从键盘上popup和select听写。 searchAPI文档,但无法find解决scheme。 有任何想法吗?

点击部分UILabel的手势

我可以使用以下代码成功地将轻拍手势添加到UITextView的一部分: UITextPosition *pos = textView.endOfDocument;// textView ~ UITextView for (int i=0;i<words*2-1;i++){// *2 since UITextGranularityWord considers a whitespace to be a word UITextPosition *pos2 = [textView.tokenizer positionFromPosition:pos toBoundary:UITextGranularityWord inDirection:UITextLayoutDirectionLeft]; UITextRange *range = [textView textRangeFromPosition:pos toPosition:pos2]; CGRect resultFrame = [textView firstRectForRange:(UITextRange *)range ]; UIView* tapViewOnText = [[UIView alloc] initWithFrame:resultFrame]; [tapViewOnText addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(targetRoutine)]]; tapViewOnText.tag = 125; […]