简体   繁体   English

如何在 iPhone sdk 中以编程方式更改键盘的背景颜色?

[英]How to change the background color of the keyboard programmatically in iPhone sdk?

I want to change the background color of the keyboard when we are entering text in a textfield or textview.当我们在文本字段或文本视图中输入文本时,我想更改键盘的背景颜色。 The default color is blue for the background.背景的默认颜色为蓝色。 How can I change this to black?如何将其更改为黑色?

You can get a dark gray background if you set the Appearance of the Text Input Traits of the Text Field to Alert.如果将文本字段的文本输入特征的外观设置为警报,则可以获得深灰色背景。 You can do this in Interface Builder under the Text Field attributes in the inspector.您可以在检查器中的文本字段属性下的界面生成器中执行此操作。

Unfortunately Apple only opens two Appearance styles for the keyboard to us 3rd party developers.不幸的是,Apple 只向我们 3rd 方开发人员开放了两种键盘外观样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM