私の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
}
}
}
これが正しい方法でない場合、配列内の画像のサイズを変更する方法を教えてください。