Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipad how to know keyboard has been hidden

Im building an ipad app,

it haves some text fields that when tapped, move above the keyboard,

if a "calculate" button is tapped, keyboard and view, go down,

but if the user taps on the hide keyboard from the ipad [bottom right corner key of keyboard]

my view remains moved high,

so, how can i know programatically that the "hide keyboard" has been tapped?

thanks a lot!

like image 545
manuelBetancurt Avatar asked Dec 20 '25 05:12

manuelBetancurt


1 Answers

You should use the notification center for tracking the keyboard,

NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(didShow) name:UIKeyboardDidShowNotification object:nil];
[center addObserver:self selector:@selector(didHide) name:UIKeyboardWillHideNotification object:nil];

//Resize your views in the below methods
- (void)didShow
{

}

- (void)didHide
{

}
like image 183
sElanthiraiyan Avatar answered Dec 22 '25 20:12

sElanthiraiyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!