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.
- enable , setup autolayout on views in xib file
- load , add subview "inputview"
- 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
Post a Comment