【问题标题】:Zoom out center UIView animation缩小中心 UIView 动画
【发布时间】:2015-11-02 16:48:31
【问题描述】:

我的viewcontroller 中有一个 UIView。它有框架 (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);
   }];
} 

【问题讨论】:

  • 谁能帮帮我?请

标签: animation uiview transform zooming ios9.1


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-08
    • 1970-01-01
    • 1970-01-01
    • 2021-07-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多