【发布时间】:2011-03-22 13:14:37
【问题描述】:
在我的 iPhone 应用程序中,我需要调整数组中的一些 UIImageView 类型的图像的大小。我没有为此任务使用 Interface Builder。
我收到此错误:
左运算符赋值需要左值
使用以下代码:
CGSize newsize;
for (int i = 0; i<5; i++)
{
// ball[] is of type UIImageView *
ball[i].center = CGPointMake(ball[i].center.x-5,ball[i].center.y);
if (ball[i].center.x <= 36)
{
while(ball[i].frame.size.width>0 && ball[i].frame.size.height>0)
{
newsize.height =val2--;
newsize.width =val2--;
ball[i].frame.size = newsize; // This line gives the error
}
}
}
如果这不是正确的方法,您能告诉我应该如何调整数组中的图像大小吗?
【问题讨论】:
标签: objective-c cocoa-touch ios uiimageview image-resizing