Resize image when keyboard is shown


#1

Hi guys, i am building a application with a login page with a logo, i was wondering if there is a good way to resize the image when the keyboard is shown to make the content fit into the screen above the keyboard


#2

you could go for an ngStyle directive where you define the size of the picture in a $scope variable, and then trigger the change in size with

window.addEventListener('native.keyboardshow', keyboardShowHandler);

function keyboardShowHandler(e){
    alert('Keyboard height is: ' + e.keyboardHeight);
    $scope.picHeight = window.innerHeight - e.keyboardHeight
}

using the keyboard plugin.


#3

Thanks, i will try that :slight_smile: