• 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
Re: Moving a textField from under keyboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving a textField from under keyboard


  • Subject: Re: Moving a textField from under keyboard
  • From: Esteban Torres <email@hidden>
  • Date: Sat, 29 Jun 2013 09:27:04 -0600

I wouldn't do the didBeginEditing approach; in case the user for whatever reason is using a Bluetooth keyboard, this will launch the scroll up method when there's not visible keyboard and will make the app look weird.

Although I know its a farfetched scenario its still possible.
What I usually do is subscribe to  "UIKeyboardWillShowNotification"

This notification will let you know when a keyboard will be shown onscreen; subsequently you should subscribe to its counter part and also add a tap gesture recogniser to the view so that you can also dismiss the keyboard by resigning the first responder of the UITextfield when the user taps anywhere else on the screen.
I add this tap gesture because I believe its a common "preconception" for the user that if they tap anywhere where there's not textfield the keyboard should dismiss.

Hope this helps; let me know if you need more details, I have a UIView category that handles this behaviour and I could share it with you if you want.

Regards,
--
Esteban Torres
(+506)8813-0934
Skype: esteban.a.torres.hernandez

On Jun 29, 2013, at 12:11 AM, Diederik Meijer | Ten Horses <email@hidden> wrote:

> One way is to animate the UiTextField upwards in the didBeginEditing delegation method and down again in the shouldReturn.
>
> Verstuurd vanaf mijn iPhone
>
> Op 29 jun. 2013 om 00:44 heeft Julius Oklamcak <email@hidden> het volgende geschreven:
>
>>> I'm looking for "something" OR some method that knows how to change (I
>> think) the position (I think) of the view containing a UITextField so the
>> TextField is visible after a keyboard comes up and covers it.  Then the view
>> goes back to normal position once the keyboard is dismissed.
>>>
>>> Is there an inspector attribute for that?
>>>
>>> Is this a delegation thing?
>>
>> Have a read through the "Managing the Keyboard" section in the "Text, Web,
>> and Editing Programming Guide for iOS".
>>
>> http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conce
>> ptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
>>
>> _______________________________________________
>>
>> 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
>
> _______________________________________________
>
> 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

_______________________________________________

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:
    • The Documentation says "that is a member variable"
      • From: YT <email@hidden>
  • Prev by Date: Re: NSSplitView similar to Xcode's editor/debug area split view
  • Next by Date: NSOpenPanel not properly validating/updating with respect to allowedFileTypes
  • Previous by thread: Re: NSSplitView similar to Xcode's editor/debug area split view
  • Next by thread: The Documentation says "that is a member variable"
  • Index(es):
    • Date
    • Thread