在原生、phonegap/Cordova 构建的 iOS 应用程序中更改键盘外观 [英] Alter keyboard appearance in native, phonegap/Cordova built iOS App

查看:26
本文介绍了在原生、phonegap/Cordova 构建的 iOS 应用程序中更改键盘外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改出现在我的 Phonegap/Cordova 构建的原生 iOS 应用程序中的所有键盘的背景颜色,如下所示:

我当然已经彻底搜索了这个,主要找到了 2 个相关的答案.回答者 here 说 Objective-C 代码可以添加到 PhoneGap 项目的 AppDelegate.m 文件中,如 this 所示 页面.我找到了 AppDelegate.m 文件,但似乎无法弄清楚如何在 所有文本字段 上将键盘外观设置为 UIKeyboardAppearanceAlert 的外观.回答者提供的代码示例:

 mytextfield.keyboardAppearance = UIKeyboardAppearanceAlert;

写一个基于cordova的应用程序,我无法区分任何文本字段ID来连接到上面的例子.Xcode/Cordova 中是否有列出所有文本字段 ID 的文件,或者甚至更好:

有没有一种方法可以通过 UIKeyboardAppearanceAlert 或类似方法将键盘外观设置为深色,适用于所有文本字段并且与 Cordova 兼容?

谢谢

解决方案

在各种社交媒体上广泛分享这个问题,更广泛深入的研究,询问朋友和熟人等后,我只能得出结论,这不可能使用phonegap和cordova完成.我希望有人能长期证明我.然而,目前,这就是我要得出的结论.

I want to change the background color of all the keyboards appearing in my Phonegap/Cordova built native iOS App as shown below:

I have googled this thoroughly of course and found mainly 2 relevant answers. The answerer here says that Objective-C code can be added to the PhoneGap project's AppDelegate.m file as shown on this page. I've located the AppDelegate.m file but can't seem to figure out how to set the keyboard appearance to that of UIKeyboardAppearanceAlert on all textfields. Code example provided by the answerer:

 mytextfield.keyboardAppearance = UIKeyboardAppearanceAlert;

Writing an app based on cordova, I can't distinguish any textfield IDs to connect to the above example. Is there a file in Xcode / Cordova in which all the textfield IDs are listed, or even better:

Is there a way in which I can set the keyboard appearance to dark through UIKeyboardAppearanceAlert or similar approaches, that applies to all textfields and is compatible with Cordova?

Thanks

解决方案

After sharing this question widely on various social media, more extensive and thorough research, asking friends and aquaintances, etc I can only come to the conclusion that this cannot be done using phonegap and cordova. I would love for anyone to prove me long. For the time being however, this is what I shall conclude.

这篇关于在原生、phonegap/Cordova 构建的 iOS 应用程序中更改键盘外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆