想在UCWEB中点击搜索栏的时候,自动填上一些字符,代码如下,在log文件中看到UITextView_firstResponder.Text也修改为test了,但是UC上没有输入,这是咋回事
%hook UITextInputTraits
- (long long)keyboardAppearance
{
UIWindow *keyWindow = [UIApplication sharedApplication] keyWindow];
UIView *firstResponder = [keyWindow performSelector:@selector(firstResponder)];
if (firstResponder)
{
UITextView *UITextView_firstResponder=(UITextView *)firstResponder;
NSLog(@“UITextView_firstResponder= %@”,UITextView_firstResponder);
[UITextView_firstResponder setText:@“test”];
}
//[firstResponder resignFirstResponder];
return %orig;
}
%end