Abh*_*nav 4 cocoa-touch objective-c uiview uikeyboard ios
我试图在默认 UIKeyboard 之上放置一个附件视图。我想将 iOS 6 和 iOS 7 的附件视图的背景颜色与键盘的背景颜色相匹配。我正在尝试使用低于 RGB 的颜色,但这没有帮助。
如果有人以前这样做过,请提出建议。
For iOS 6
myAccessoryView.tintColor = [UIColor colorWithRed:105.0f/255.0f green:114.0f/255.0f blue:125.0f/255.0f alpha:1.0f];
For iOS 7
myAccessoryView.tintColor = [UIColor colorWithRed:(81.0f / 255.0f) green:(81.0f / 255.0f) blue:(81.0f / 255.0f) alpha:0.98f]
Run Code Online (Sandbox Code Playgroud)
对于 iOS7,您可以使用 UIInputView。为了支持 iOS6,您将不得不投入更多的工作,基本上是对 UIToolBar 进行子类化并设置正确的tintColor。请参阅如何在 iPhone 上扩展键盘渐变?了解更多信息