Take a look at the following image:

As you can see, the edges are a sharp rectangle and they come out of a rounded corner button. How can I not show the edges and show only the round button?
UPDATE (decision):
I used the following code to achieve round corners:
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.stopButton.bounds byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(12.0, 12.0)];
NEW CHALLENGE:
This code gives me an error in the line startButtonRound.layer.cornerRadius.
UIButton *roundStartButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; roundStartButton.frame = CGRectMake(10, 10, 100, 20); [roundStartButton setBackgroundImage:[UIImage imageNamed:@"green_gradient.jpg"] forState:UIControlStateNormal]; roundStartButton.layer.cornerRadius = 12.0; UIBarButtonItem *startButton = [[UIBarButtonItem alloc] initWithCustomView:roundStartButton];
ios xcode4
azamsharp
source share