首先,我对iPhone开发人员非常感兴趣,如果这很容易,我很抱歉。

是否可以更改iPhone键盘上的透明度(如果可能的话,甚至是颜色)。

我知道你可以获得对键盘视图的引用(提供的链接) http://www.iphonedevsdk。 COM /论坛/ iphone-SDK-教程/ 7350-加入-子视图-custimize-keyboard.html

我发现这个stackoverflow帖子让我相信它可以通过动画完成。 iPhone UIView动画最佳实践

但我不知道我会把这段代码放在哪里。

感谢您的任何想法和评论。一切友好的赞赏:)

-TK

感谢评论家伙。我不在乎它是否通过了应用程序商店。只是想尝试去做。再次感谢:)

有帮助吗?

解决方案

公共API中只有两种样式可用:

[textView setKeyboardAppearance:UIKeyboardAppearanceAlert];
[textView setKeyboardAppearance:UIKeyboardAppearanceDefault];

但您可以使用私有API方法来检索键盘实现:

id keyboardImpl = [objc_getClass("UIKeyboardImpl") sharedInstance];

并使其不那么不透明,

[keyboardImpl setAlpha:0.8f];

色调,

UIView *tint = [[UIView alloc] initWithFrame:[keyboardImpl frame]];
[tint setBackgroundColor:[UIColor colorWithRed:0.0f green:0.0f blue:1.0f alpha:0.3f]];
[tint setUserInteractionEnabled:NO];
[[keyboardImpl superview] insertSubview:tint aboveSubview:keyboardImpl];
[tint release];

甚至翻转它:

[[keyboardImpl window] setTransform:CGAffineTransformMakeScale(-1.0f, 1.0f)];

但所有这些都会阻止您的应用被批准

其他提示

如果你能做到这一点,Apple会拒绝你的应用程序,因为你正在攻击属于操作系统的对象(不是说我同意这一点,但Apple非常关注人们改变用户界面的外观)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top