आईओएस 11 बीटा 7 पर मेरे ऐप का परीक्षण करने के लिए UIKeyboardWillShowNotification समस्याएं - ऐसा लगता है जैसे कीबोर्ड मेरे UIViewController को सामग्री को धक्का नहीं देता है।आईओएस 11 बीटा 7
कोड इस (iOS7 के बाद से काम कर) की तरह दिखता है:
- (void)handleNotification:(NSNotification*)notification {
if (notification.name == UIKeyboardWillShowNotification) {
CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
nextButtonALBottomDistance.constant = keyboardSize.height + initialPhoneBottomDistance;
codeBottomViewALBottomDistance.constant = keyboardSize.height + initialCodeBottomDistance;
double animationDuration = [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[UIView animateWithDuration:animationDuration animations:^{
[self.view layoutIfNeeded];
}];
}
else if (notification.name == UIKeyboardWillHideNotification) {
nextButtonALBottomDistance.constant = initialPhoneBottomDistance;
codeBottomViewALBottomDistance.constant = initialCodeBottomDistance;
double animationDuration = [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[UIView animateWithDuration:animationDuration animations:^{
[self.view layoutIfNeeded];
}];
}
}
काफी दिलचस्प है - जब मैं घर बटन (एप्लिकेशन को न्यूनतम) और इसे फिर से खोलने (यह की हत्या के बिना) प्रेस - लेआउट तय किया गया है।
यह आईओएस 11 बीटा बग जैसा लगता है, लेकिन मुझे अब तक इसका कोई संदर्भ नहीं मिला।
किसी और को यह समस्या होने पर जानना अच्छा है।
'UIKeyboardFrameBeginUserInfoKey' को 'UIKeyboardframeenduserinfokey' –
के साथ बदलें, काम करने लगता है! बहुत बहुत धन्यवाद @ आदित्य श्रीवास्तव! – Gil
आपकी मदद करने में खुशी हुई –