Iphone 更改UIImageView的宽度

Iphone 更改UIImageView的宽度,iphone,objective-c,Iphone,Objective C,您将如何更改objective-c中UIImageView的宽度?目前我正在这样做: imageview.frame = GCRectMake(x,y,width,height); 但当我改变宽度时,似乎只是改变了位置,而不是改变了大小。试试这个: CGRect frame = [imageView frame]; frame.size.width = newWidth; [imageView setFrame:frame]; 试试这个: CGRect frame = [imageView

您将如何更改objective-c中UIImageView的宽度?目前我正在这样做:

imageview.frame = GCRectMake(x,y,width,height);
但当我改变宽度时,似乎只是改变了位置,而不是改变了大小。

试试这个:

CGRect frame = [imageView frame];
frame.size.width = newWidth;
[imageView setFrame:frame];
试试这个:

CGRect frame = [imageView frame];
frame.size.width = newWidth;
[imageView setFrame:frame];