Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用ImageView创建图像库时出现问题';开始了争吵和接触_Ios_Objective C_Imageview - Fatal编程技术网

Ios 使用ImageView创建图像库时出现问题';开始了争吵和接触

Ios 使用ImageView创建图像库时出现问题';开始了争吵和接触,ios,objective-c,imageview,Ios,Objective C,Imageview,我正在尝试为我的iPhone应用程序创建一个图像库。我已经布置好了ImageView,我希望当用户单击它们时,它们的大小会增加,然后在释放时恢复正常。我制作的代码适用于第一个图像,但其余的完全没有响应。即使我完全移除第一个 这是我一直试图使用的代码,有人知道为什么它可能不起作用吗 谢谢 - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject];

我正在尝试为我的iPhone应用程序创建一个图像库。我已经布置好了ImageView,我希望当用户单击它们时,它们的大小会增加,然后在释放时恢复正常。我制作的代码适用于第一个图像,但其余的完全没有响应。即使我完全移除第一个

这是我一直试图使用的代码,有人知道为什么它可能不起作用吗

谢谢

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
if ([touch view] == _imageOne)
{
CGRect newFrame = _imageOne.frame;
newFrame.size.width += 280;
newFrame.size.height += 280;
_imageOne.frame = newFrame;
}
if ([touch view] == _imageTwo)
{
    CGRect newFrame2 = _imageTwo.frame;
    newFrame2.size.width += 280;
    newFrame2.size.height += 280;
    _imageTwo.frame = newFrame2;
}
}

- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
if ([touch view] == _imageOne)
{
    CGRect newFrame = _imageOne.frame;
    newFrame.size.width -= 280;
    newFrame.size.height -= 280;
    _imageOne.frame = newFrame;
}
if ([touch view] == _imageTwo)
{
    CGRect newFrame2 = _imageTwo.frame;
    newFrame2.size.width -= 280;
    newFrame2.size.height -= 280;
    _imageTwo.frame = newFrame2;
}
}

你在使用自动布局吗?老实说,我不太确定!我似乎在右边找不到它