【发布时间】:2015-10-26 22:16:30
【问题描述】:
我正在尝试使用这些函数调整图像视图的大小:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch* mTouch = [touches anyObject];
if (mTouch.view == [self Logo_01]) {
CGPoint cp = [mTouch locationInView:[self view]];
[[mTouch view]setCenter:CGPointMake(cp.x-xd, cp.y-yd)];
NSLog(@"questo è x");
NSLog(@"lalal %f", cp.y);
if (cp.y > 390) {
[_Logo_01 setHidden:YES];
}
if (cp.y < 130) {
[_Logo_01 setHidden:YES];
}
if (cp.x > 290) {
[_Logo_01 setHidden:YES];
}
if (cp.x < 40) {
[_Logo_01 setHidden:YES];
}
}
当我在应用程序上调整我的徽标大小时,图像会正确调整大小,但我的中心点是错误的
对不起,我错误地发布代码 这是我用来缩放图像的代码:
- (IBAction)ScaleImage1:(UIPinchGestureRecognizer *)recognizer
{
recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
recognizer.scale = 1;
CGFloat height = _Logo_01.frame.size.height;
NSLog(@"SIZE ===== %f", height);
if (height > 600) {
[_Logo_01 setHidden:YES];
}
}
【问题讨论】:
标签: ios objective-c cocoa-touch uiimageview image-resizing