i'm talking about software keyboard which shows on device screen i have view controller in my storyboard....now in ipad i view it in portrait mode then i press on textfield then keyboard is visible now when i set it to landscape left or right then on viewdid layout subview i want to detect whether keyboard is visible or not on the screen...
Use the UIKeyboard.Notifications.ObserveWillShow method to detect when the keyboard is shown and the UIKeyboard.Notifications.ObserveWillHide method to detect when the keyboard is hidden. One thing to be aware of is that you may get multiple calls to the "will show" callback before getting a "will hide" callback. They are not guaranteed to be balanced. Basically, any time the software keyboard changes size you'll get a "will show" notification to let you know the new size. Also keep in mind that the framework only considers the software keyboard to be "showing" (as far as the notifications go) when it is docked. A floating keyboard (merged or not) will not invoke those callbacks. The reasoning is that these notifications are used to move things out of the way of the keyboard, but if the keyboard is undocked then the user can move the keyboard instead. Your app shouldn't try to move out of the way of an undocked keyboard.
Answers
What do you mean by that exactly? Do you mean detect a hardware keyboard or detect when the software keyboard is visible?
i'm talking about software keyboard which shows on device screen i have view controller in my storyboard....now in ipad i view it in portrait mode then i press on textfield then keyboard is visible now when i set it to landscape left or right then on viewdid layout subview i want to detect whether keyboard is visible or not on the screen...
See here.
still din't get my ans...can u please help me...
Use the
UIKeyboard.Notifications.ObserveWillShow
method to detect when the keyboard is shown and theUIKeyboard.Notifications.ObserveWillHide
method to detect when the keyboard is hidden. One thing to be aware of is that you may get multiple calls to the "will show" callback before getting a "will hide" callback. They are not guaranteed to be balanced. Basically, any time the software keyboard changes size you'll get a "will show" notification to let you know the new size. Also keep in mind that the framework only considers the software keyboard to be "showing" (as far as the notifications go) when it is docked. A floating keyboard (merged or not) will not invoke those callbacks. The reasoning is that these notifications are used to move things out of the way of the keyboard, but if the keyboard is undocked then the user can move the keyboard instead. Your app shouldn't try to move out of the way of an undocked keyboard.I need check if keyboard is visible when button is clicked, i can do that? how?