自定义图层 注意

    calayer=[CALayer layer];
    // SCMylayer *layer = [SCMylayer layer];
    //2.设置layer的属性
    calayer.backgroundColor=[UIColor clearColor].CGColor;
    calayer.bounds=CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT*0.5);
    calayer.anchorPoint=CGPointZero;
    calayer.position=CGPointMake(0, 108);
    calayer.delegate=self;
    [self.view.layer addSublayer:calayer];
  
    color=[UIColor blackColor];
    arrM=[NSMutableArray array];
    isOpen=NO;
}
-(void)dealloc{
    NSLog(@"------========="); 
    [calayer removeFromSuperlayer]; //销毁是移除涂层
}

  

posted @ 2015-09-08 10:59  Athook  阅读(192)  评论(0编辑  收藏  举报