浏览 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 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |