• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Insetting a UIWebView while a keyboard is on screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Insetting a UIWebView while a keyboard is on screen


  • Subject: Insetting a UIWebView while a keyboard is on screen
  • From: Nick Zitzmann <email@hidden>
  • Date: Tue, 27 May 2014 22:40:14 -0500

Short question: What's the best way to scroll a UIWebView slightly from its current position when there's a keyboard present? I already tried -[UIScrollView setContentInset:], but that does not work when a keyboard is on screen.

Long question:

I have a UIWebView, and I'm trying to graft a custom keyboard extension onto it that will appear on top of the keyboard. Since UIWebView doesn't support -inputAccessoryView, I've made this happen by listening for UIKeyboardWillShowNotification, and then adding the extension view as a subview when the notification is received.

This works fine, except that the spot the user is editing might appear underneath the keyboard extension, so I need to inset the scroll view in order to compensate for this or the user won't be able to see what they are editing. So I tried adjusting the scroll view's content inset, but I noticed that UIWebView makes its own adjustment to the content inset whenever the keyboard appears, and the attempt to change it twice in a row seems to cause the content inset to change to some other number internally for some reason. So how do I move the scroll view slightly if adjusting the content inset won't work?

Nick Zitzmann
<http://www.chronosnet.com/>




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Insetting a UIWebView while a keyboard is on screen
      • From: Diederik Meijer <email@hidden>
  • Prev by Date: Limit on CGImageDestination?
  • Next by Date: Re: Insetting a UIWebView while a keyboard is on screen
  • Previous by thread: Limit on CGImageDestination?
  • Next by thread: Re: Insetting a UIWebView while a keyboard is on screen
  • Index(es):
    • Date
    • Thread