iOS Keyboard Colour Changes - keyboardAppearance dark color doesn't stick

浪子不回头ぞ 提交于 2020-06-27 07:31:14

问题


In our app, we set the keyboardAppearance to dark. This produces a black keyboard, as expected. However, if the keyboard is showing, and we press the home button, and then go back into the app, the keyboard turns white, as shown. Any ideas why?

wrong colored dark keyboard


回答1:


It may have todo with the fact that the keyboard is a global object. There's only ever one keyboard in memory at any given time. Also, the OS will automatically change the keyboard color based on the background. Therefore, your setting is probably just getting overridden. I would suggest hiding the keyboard when your app enters the background, and then re-show it when it re-enters the foreground. Then when you re-show the keyboard reset the keyboard appearance via code.



来源:https://stackoverflow.com/questions/28114505/ios-keyboard-colour-changes-keyboardappearance-dark-color-doesnt-stick

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!