【问题标题】:Pinch, Pan, and Rotate Image view Simultaneously like Instagram story using Objective-C使用 Objective-C 像 Instagram 故事一样同时捏合、平移和旋转图像视图
【发布时间】:2019-08-28 04:48:58
【问题描述】:

我正在尝试制作像 instagram 故事帖子视图一样工作的图像视图。我在 UIImageView 上添加了 UIPinchGestureRecognizer、UIPanGestureRecognizer 和 UIRotationGestureRecognizer 手势。现在我想让所有手势像 instagram 故事帖子视图一样同时工作。

提前致谢。

【问题讨论】:

    标签: ios objective-c swift instagram uigesturerecognizer


    【解决方案1】:

    您可以使用https://github.com/twomedia/TMImageZoom

    如果您仍在寻找实现部分,请查看以下链接:

    https://blog.usejournal.com/ig-pinch-drag-swift-4-390da4f86ead

    希望这能解决你的问题。

    【讨论】:

    • 感谢您的回答。但这不符合我的要求。
    • 您有什么要求,上面的链接没有满足?
    【解决方案2】:

    继承UIGestureRecognizerDelegate,设置手势委托给视图控制器。

    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, 
    shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool{
        return true
    }
    

    在此处阅读详细信息: https://developer.apple.com/documentation/uikit/uigesturerecognizerdelegate/1624208-gesturerecognizer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-24
      • 1970-01-01
      • 1970-01-01
      • 2011-11-22
      相关资源
      最近更新 更多