0

I am building a custom keypad for my application, i want to make the look and feel of button's like the default keypad of iPad.i have apply gradient on the button but its not give the same look and feel,

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

it gives the look like thisthe screen shot of output

kindly suggest what could be the solution for that

thanks,

Rana Anees
  • 307
  • 2
  • 13

1 Answers1

1

There is an Excellent Answer given for your Question at How do I replicate the iOS keyboard appearance ?

I don't need to give any Explanation as everything is given there. This is the Perfect Answer for your Question , I think so.

Community
  • 1
  • 1
Bhavin
  • 27,155
  • 11
  • 55
  • 94