根据触摸移动分别更改图像帧宽度或高度,而无需更改UIImageView的帧

时间:2015-12-20 11:21:54

标签: ios objective-c uiimageview uiimage transform

我的应用程序将显示一个图像,允许用户分别调整高度或宽度。目前我有一个UIImageView显示图像并允许多点触控(假装是捏手势)。

如何在不更改UIImageView框架的情况下转换图像宽度/高度?

Original Image touchMove to change height touchMove to change width

问题是如何在不触及UIImageView.frame的情况下更改图像大小

- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {

    if (pinch == widthChange) {
       // Calculate moving distance and become image size change factor
       // Perform Image size change
    } else if (pinch == heightChange) {

    }
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    //Mark the touch points for compare
}

0 个答案:

没有答案