给视图添加阴影

UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(1, 1, 66.0f, 76.0f)];
  
   imageview.tag=1;
   [imageview setImage:img];
   imageview.layer.shadowColor=[UIColor blackColor].CGColor;
   imageview.userInteractionEnabled=YES;
   imageview.layer.shadowOpacity=0.5;
   imageview.layer.shadowOffset = CGSizeMake(5,3);
  
   imageview.layer.shadowColor = [UIColor blueColor].CGColor;

此代码再3.1.3下运行失败。

posted on 2011-06-13 12:10  禚来强  阅读(1150)  评论(0)    收藏  举报

导航