iphone - iOS 8 custom keyboards orientation change -


i built keyboard ios 8 using 1 xib file , multiple subviews. keyboard works in portrait mode , when device rotates, keyboard doesn't change size or length. figured need create xib file subviews landscape , when device rotates have xib files switch. question how go accomplishing this? how make program knows when switch xib files. thinking should use proposed in here: https://stackoverflow.com/a/25222353/2057171 not know how implement it. appreciated.

one xib both portrait , landscape

it's possible have 1 xib both portrait , landscape, if enable autolayout on views in xib file. these steps did in own test keyboard.

  1. enable , setup autolayout on views in xib file
  2. load , add subview "inputview"
  3. programmatically setup constraints subview in relation inputview

"inputview" automatically changes sizes when switching between portrait , landscape, when have constraints setup view in relation "inputview", view adjust automatically.

separate xib portrait , landscape

if decide have separate xib files portrait , landscape views, might need load , add correct subview inputview whenever orientation changes. haven't done believe updateviewconstraints() called whenever orientation changes can implement logic there.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -