iphone - When I rotate iOS screen, collection view cell is going wrong -


when rotate ios screen without keyboard , it's fine. keyboard, rotate screen, cell going wrong. don't know how explain in english, uploaded screenshot.

this screenshot

swift solution

override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) {     if uidevice.currentdevice().orientation.islandscape.boolvalue {         print("landscape")         view.endediting(true)     } else {         print("portrait")         view.endediting(true)     } } 

objective-c solution

[[uidevice currentdevice] begingeneratingdeviceorientationnotifications];  if ( ([[uidevice currentdevice] orientation] ==  uideviceorientationportrait)  ) {    // portrait mode   [[self view] endediting:yes]; } else if(([[uidevice currentdevice] orientation] == uideviceorientationlandscaperight) || ([[uidevice currentdevice] orientation] == uiinterfaceorientationlandscapeleft)) {    // landscape mode    [[self view] endediting:yes]; } 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -