// 添加圆角
self.layer.cornerRadius = 15.0f;
[self.layer setMasksToBounds:YES];
// 添加渐变
UIView *topShadowView = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.origin.x+kLeftPadding,
self.bounds.origin.y + self.bounds.size.height - kShadowHeight
,self.bounds.size.width-kLeftPadding - kRightPadding , kShadowHeight)];
CAGradientLayer *topShadow = [CAGradientLayer layer];
topShadow.frame = CGRectMake(0, 0, topShadowView.bounds.size.width, kShadowHeight);
topShadow.colors = [NSArray arrayWithObjects:(id)[[UIColor blackColor] CGColor], (id)[[UIColor clearColor] CGColor], nil];
[topShadowView.layer insertSublayer:topShadow atIndex:0];
[self addSubview:topShadowView];