开发者

FoneMonkey able to input text to a UITextView?

So far found ways to get FoneMonkey to behave for most of what I'm scripting, however, when trying to enter text into a UITextView, it does not capture it during开发者_如何学Go recording. If I manually add a InputText command for the UITextView, it does not actually input the text.

I'm using the latest version (5.0b).

Unless I missed them, there are no specific examples in the doc showing a command for entering text in a UITextView (there are for UITextField, and that does work for me).


You can input text with the built-in FMCommandInputText command, like so:

NSMutableArray *array = [NSMutableArray array];

[array addObject:[FMCommandEvent command:FMCommandTouch className:UITextView
                                    monkeyID:TEXTVIEW_MONKEYID args:nil]];

[array addObject:[FMCommandEvent command:FMCommandInputText className:UITextView
                                monkeyID:TEXTVIEW_MONKEYID 
                                    args:[NSArray arrayWithObjects:yourText, nil]]];

result = [FoneMonkeyAPI playCommands:array];

Does this work?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜