I've got a UITextField added as a subview to a UIWebView that acts as an address bar for a browser. But it's behaving rather strangely, because when the field begins editing the webView automatically scrolls itself to about (-40, 0) and I can't figure out why. I've already tried calling [webView setContentOffset] to counteract this behavior, but that doesn't work for some reason (yes I have the delegate connected). Am I missing something?
Asked
Active
Viewed 83 times
0
-
perhaps something to do with the keyboard firstResponder stuff? (Naive guess) – bkbeachlabs Jul 07 '13 at 18:39
-
Your code would be suuuuper helpful – bkbeachlabs Jul 07 '13 at 18:39
1 Answers
0
I hope you have set the delegates for the textfield too, and in delegate method
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
, reset the webview content
[webView setContentOffset]
I hope this will serve you better.

yunas
- 4,143
- 1
- 32
- 38