プログラマメモ2 - programmer no memo2

CALayerをアッド 2012/05/05

cocoaです。CALayerをviewにaddです。すぐにコードがでてこなかったので。

UIImage *image = [UIImage imageNamed:@"help.png"]; CALayer* layer=[CALayer layer]; layer.contents = (id)image.CGImage; [layer setBounds:CGRectMake(0,0,image.size.width,image.size.height)]; [layer setPosition:CGPointMake(160,240)]; [layer setAnchorPoint:CGPointMake(0.5f,0.5f)]; [self.view.layer addSublayer:layer];

: