原文地址:

http://www.cocoachina.com/bbs/read.php?tid=84629 

 

      UIView *myView = [[UIView alloc] initWithFrame:CGRectZero];

    CGRect rect = myView.frame;
    rect.size = CGSizeMake(100.0, 100.0);
    myView.frame = rect;
    myView.center = mainScroller.center;
    myView.layer.borderColor = [UIColor whiteColor].CGColor;
    myView.alpha = 0.5;
    myView.layer.borderWidth = 3.0;
    myView.backgroundColor = [UIColor blueColor];
    [mainScroller addSubview:myView];
    [myView release];
     
    CGFloat angle = M_PI / 30.0;
    [myView.layer setTransform:CATransform3DRotate(myView.layer.transform, angle, 0.0, 0.0, 1.0)];
     
    myView.layer.shadowOffset = CGSizeMake(0, 2);//0,2
    myView.layer.shadowRadius = 3.0;
    myView.layer.shadowColor = [UIColor whiteColor].CGColor;
    myView.layer.shadowOpacity = 1.0;
    myView.layer.shouldRasterize = YES;
    myView.layer.edgeAntialiasingMask = kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge;
    myView.layer.masksToBounds = YES;

相关文章:

  • 2021-08-09
  • 2021-06-06
  • 2021-08-22
  • 2021-04-09
  • 2021-07-27
  • 2022-12-23
  • 2021-06-14
  • 2022-01-07
猜你喜欢
  • 1970-01-01
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案