论坛首页 移动开发技术论坛

iphone-common-codes-ccteam源代码 CCCALayer.m

浏览 1470 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2012-01-07   最后修改:2012-01-09
//  
//  CCCALayer.m  
//  CCFC  
//  
//  Created by xichen on 11-12-24.  
//  Copyright 2011 ccteam. All rights reserved.  
//  
  
#import "CCCALayer.h"  
  
  
@implementation CALayer(cc)  
  
+ (void)addTestLayer:(UIView *)view withRect:(CGRect)rect  
{  
    CALayer *layer = [[CALayer alloc] init];  
    layer.frame = rect;  
      
    UIColor *greenColor = [UIColor greenColor];  
    [layer setBackgroundColor:greenColor.CGColor];  
    [view.layer insertSublayer:layer atIndex:0];  
}  
  
- (void)setBg:(UIImage *)img  
{  
    self.contents = img.CGImage;  
}  
  
@end  


googlecode链接地址(会有更新):http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCCALayer.m
论坛首页 移动开发技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics