【问题标题】:Rotating image like in standard feature ios objective c像标准功能 ios 目标 c 中的旋转图像
【发布时间】:2017-08-21 10:06:09
【问题描述】:

如何像在标准图库功能中那样旋转图像?标准图库有滚轮,用户可以用一根手指点击并从左向右滑动,然后将图像旋转 45 度。 这是我的意思的截图:

【问题讨论】:

    标签: ios objective-c image rotation transformation


    【解决方案1】:

    试试这个代码旋转。

    CGAffineTransform newTransform = CGAffineTransformMakeRotation((CGFloat)(angel));
    
    self.imageView.transform = newTransform;
    

    【讨论】:

      【解决方案2】:

      试试这个代码进行轮换。

      CGFloat degrees = 45.0f; //the value in degrees
      CGFloat radians = degrees * M_PI/180;
      imageView.transform = CGAffineTransformMakeRotation(radians);
      

      【讨论】:

        【解决方案3】:

        我认为你需要单指旋转。

        这是您可以使用的库:

        https://github.com/zedoul/ZDStickerView

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-09-30
          • 1970-01-01
          • 2011-07-24
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多