BenMills
BenMills

Reputation: 1095

Change width of UIImageView

How would you change just the width of a UIImageView in objective-c? Currently I'm doing this:

imageview.frame = GCRectMake(x,y,width,height);

But when I change the width it seems to just change the position rather then change the size.

Upvotes: 1

Views: 3857

Answers (1)

Jasarien
Jasarien

Reputation: 58458

try this:

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

Upvotes: 7

Related Questions