【问题标题】:IPad custom keypad styling?iPad自定义键盘样式?
【发布时间】:2013-06-06 22:36:58
【问题描述】:

我正在为我的应用程序构建一个自定义键盘,我想让按钮的外观和感觉就像 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

它看起来像这样

请提出解决方案

谢谢,

【问题讨论】:

  • 如果您觉得我的回答对您有帮助,请点赞并接受。

标签: iphone ios ipad ios4 ios-simulator


【解决方案1】:

How do I replicate the iOS keyboard appearance ? 为您的问题提供了很好的答案

我不需要给出任何解释,因为这里已经给出了一切。这是您问题的完美答案,我想是的。

【讨论】:

    猜你喜欢
    • 2011-02-03
    • 1970-01-01
    • 2014-12-21
    • 1970-01-01
    • 1970-01-01
    • 2018-07-16
    • 1970-01-01
    • 1970-01-01
    • 2011-06-13
    相关资源
    最近更新 更多