0

我的viewcontroller. 它有框架 (34,250,253,193),它是水平的中心。我想放大和缩小这个 UIView。使用放大,它可以很好地与中心配合使用。但是,使用缩小,它工作不正确。目前,视图从右向左缩小。我不想要这个。我希望它以中心缩小。

这是我的代码

-(void)zoomin:(UIView*)view {
   view.transform = CGAffineTransformMakeScale(0.1,0.1);
   [UIView animateWithDuration:2.0 animations: ^{
      view.transform = CGAffineTransformMakeScale(1,1);
   }];
}

-(void)zoomout:(UIView*)view {
   view.transform = CGAffineTransformMakeScale(1,1);
   [UIView animateWithDuration:2.0 animations: ^{
      view.transform = CGAffineTransformMakeScale(0.1,0.1);
   }];
} 
4

1 回答 1

0

问题是,就您所展示的而言,您的代码运行良好:

在此处输入图像描述

因此,从逻辑上讲,如果有问题,它是由你没有显示的东西引起的。但是由于您没有显示它,因此无法知道它是什么(除了猜测)。

于 2015-11-04T18:51:59.937 回答