iOS开发QQ空间半透明效果的实现

//1.首先我们可以确定的是cell的半透明,

 /*

     white

     The grayscale value of the color object, specified as a value from 0.0 to 1.0.

     alpha

     The opacity value of the color object, specified as a value from 0.0 to 1.0.

*/

    cell.backgroundColor = [UIColor colorWithWhite:1 alpha:0.5];设置cell的背景颜色为白色半透明

这样cell就可以实现半透明效果了,下面是研究下面的图片怎么放上去的了

我的做法是把图片画进去

//重写drawRect把图片画进去就可以了

- (void)drawRect:(CGRect)rect {

    [[UIImage imageNamed:@"1.jpg"] drawInRect:rect blendMode:kCGBlendModePlusDarker alpha:0.8];

  }

背景图片是我在百度中找的一张图片凑合看一下吧

 

posted @ 2016-08-03 17:57  sujianbo  阅读(572)  评论(0编辑  收藏  举报