iphone - iPad 自定义键盘样式?

标签 iphone ios ipad ios4 ios-simulator

我正在为我的应用程序构建一个自定义键盘,我想让按钮的外观和感觉像 iPad 的默认键盘一样。我在按钮上应用了渐变,但它没有提供相同的外观和感觉,

CAGradientLayer *layer1 = [CAGradientLayer layer];
    NSArray *colors1 = [NSArray arrayWithObjects:
                       (id)[UIColor colorWithRed:0.9333f green:0.9333f blue:0.9411f alpha:1.0f].CGColor,
                       (id)[UIColor colorWithRed:0.8235f green:0.8235f blue:0.8470f alpha:1.0f].CGColor,
                       nil];
    [layer1 setColors:colors1];
    [layer1 setFrame:self.sevenButton.bounds];
    self.sevenButton.layer.cornerRadius = 8.0f;
    self.sevenButton.layer.masksToBounds = NO;
    self.sevenButton.layer.borderWidth = 0.5f;
    self.sevenButton.layer.shadowColor = [UIColor darkGrayColor].CGColor;
    self.sevenButton.layer.shadowOpacity = 0.4;
    //self.sevenButton.layer.shadowRadius = 12;
    self.sevenButton.layer.shadowOffset = CGSizeMake(8.0f, 8.0f);
    [self.sevenButton.layer insertSublayer:layer1 atIndex:0];
    self.sevenButton.clipsToBounds = YES

它看起来像这样 the screen shot of output

请提出解决方案

谢谢,

最佳答案

您的问题在 How do I replicate the iOS keyboard appearance ? 得到了很好的答案

我不需要给出任何解释,因为一切都在那里给出。我认为这是您问题的完美答案。

关于iphone - iPad 自定义键盘样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17038002/

相关文章:

iphone - ipad锁定: launch app on boot?

ios - 我可以删除 Xcode.app/Contents/Developer/下的平台吗?

iphone - 与 APNS 服务器交互以向 iOS 设备发送推送通知的最简单方法是什么?

iphone - 在 UIView 中存储额外的关联信息

ios - 在 UINavigationController 之上添加 View

objective-c - NSFileManager setUbiquitous:是,我的文件陷入了困境!为什么?

iphone - 更改 tableHeaderView 的高度会隐藏单元格

ios - 如何执行从 UITableView 到 UIView 的 segue?

iphone - 如何在 iOS 10 Swift 3.0 Xcode 8.2 中停止 iPad 中的横向旋转

iphone - 在MKAnotationView Xcode中添加多行字幕