1.图片头像切成圆【不是半径的话 不是正圆】
self.imgvHead.clipsToBounds =YES;
self.imgvHead.layer.cornerRadius = self.imgvHead.bounds.size.height/2;
self.imgvHead.layer.borderWidth = 0.5f;
self.imgvHead.layer.borderColor = [UIColor colorWithRed:0green:0blue:0alpha:0.3].CGColor;
2.UILabel底部显示一条线
NSMutableAttributedString *str = [[NSMutableAttributedStringalloc] initWithString:self.lblCheckDetail.text];
NSRange strRange = {0,[strlength]};
[str addAttribute:NSUnderlineStyleAttributeNamevalue:[NSNumbernumberWithInteger:NSUnderlineStyleSingle]range:strRange];
[self.lblCheckDetailsetAttributedText:str];
3.自定义一个透明度渐变的效果
UIColor *colorOne = [UIColorcolorWithRed:(33/255.0) green:(33/255.0) blue:(33/255.0) alpha:0.0];
UIColor *colorTwo = [UIColorcolorWithRed:(33/255.0) green:(33/255.0) blue:(33/255.0) alpha:1.0];
NSArray *colors = [NSArrayarrayWithObjects:(id)colorOne.CGColor, colorTwo.CGColor, nil];
NSNumber *stopOne = [NSNumbernumberWithFloat:0.0];
NSNumber *stopTwo = [NSNumbernumberWithFloat:1.0];
NSArray *locations = [NSArrayarrayWithObjects:stopOne, stopTwo, nil];
CAGradientLayer *headerLayer = [CAGradientLayerlayer];
headerLayer.colors = colors;
headerLayer.locations = locations;
CGFloat width =self.viewGradualAlpha.bounds.size.width + SCREEN_WIDTH -self.cellimgvTop.bounds.size.width;
CGFloat height=self.viewGradualAlpha.bounds.size.height;
headerLayer.frame =CGRectMake(0,0, width, height);
[self.viewGradualAlpha.layerinsertSublayer:headerLayer atIndex:0];