Project: titanium
Issue TIMOB-14544: iOS: keyboardFrameChanged before keyboard is shown
keyboardFrameChanged event doesn't do much good as it is fired after the keyboard has already been displayed. to create responsive layouts with different keyboard sizes we need to know keyboard size BEFORE the keyboard is displayed. iphone/Classes/AppModule.m line 386-407 could be changed to something like this {code:objc} -(void)startup {	WARN_IF_BACKGROUND_THREAD_OBJ;	//NSNotificationCenter is not threadsafe! NSNotificationCenter * nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(willShutdown:) name:kTiWillShutdownNotification object:nil]; [nc addObserver:self selector:@selector(willShutdownContext:) name:kTiContextShutdownNotification object:nil]; #if __IPHONE_OS_VERSION_MIN_ALLOWED >= __IPHONE_5_0 if ([TiUtils isIOS5OrGreater]) { [nc addObserver:self selector:@selector(keyboardFrameChanged:) name:UIKeyboardWillChangeFrameNotification object:nil]; } #else [nc addObserver:self selector:@selector(keyboardFrameChanged:) name:UIKeyboardWillShowNotification object:nil]; [nc addObserver:self selector:@selector(keyboardFrameChanged:) name:UIKeyboardWillHideNotification object:nil]; [nc addObserver:self selector:@selector(timeChanged:) name:UIApplicationSignificantTimeChangeNotification object:nil]; #endif	[super startup]; } {code} Either that or provide access to both Will and Did. e.x. {code:javascript} Ti.App.addEventListener('keyboardFrameChanged', function(e){	var val = Ti.Platform.displayCaps.platformHeight - e.keyboardFrame.y;	$.container.animate({bottom:val, duration:300}, function() { Ti.API.log("handleAnimateEnd"); }); }); {code}
Story points: 8