开发者

Zooming in/out a UIView by a button iPhone

Hi all I need to zoon in and out a UIView by a button/segmented controll as seen below.

Zooming in/out a UIView by a button iPhone

Is that possible without using sc开发者_StackOverflow中文版roll view?Pleae help


Yes, you can set the view's transform. In particular CGAffineTransformMakeScale will probably be useful to you.


The ABOVE code is actually right!! But Here I am Just elaborating it..as what i have used..

-(IBAction)zoomin:(id)sender{

self.view.transform = CGAffineTransformMakeScale(.5,.5);
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.9];
//self.view.transform = CGAffineTransformMakeScale(1.5,1.5);
[UIView commitAnimations];

} -(IBAction)zoomout:(id)sender{

self.view.transform = CGAffineTransformMakeScale(1,1);
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.9];
//self.view.transform = CGAffineTransformMakeScale(1.5,1.5);
[UIView commitAnimations];

}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜