私は CGAffineTransforms を研究してきましたが、ビューを取得して x、y 座標にズームインする方法があるかどうか疑問に思っていました。関数でスケーリング部分を縮小しました:
CGAffineTransformMakeScale(4.00 ,4.00);
ただし、スケーリングを可能なx、y座標と結び付ける方法がわかりません。誰かがこのようなことをしたことがありますか?これらの関数の使用法が間違っている可能性がありますか?
-(void)buttonSelected:(id)sender
{
UIButton *b = sender;
CGPoint location = b.frame.origin;
[UIView animateWithDuration:1.3f delay:0.0f options:UIViewAnimationCurveEaseIn animations:^{
CGAffineTransform totalTransform =
CGAffineTransformMakeTranslation(-location.x , -location.y );
totalTransform = CGAffineTransformScale(totalTransform, 4.0f, 4.0f);
totalTransform = CGAffineTransformTranslate(totalTransform, location.x , location.y );
[self.view setTransform:totalTransform];
}completion:^(BOOL finished) {
}];
}