How to install UIImage frame

How can I set the UIImage frame size.

+8
iphone uiimage
source share
2 answers

You can set the UIImageView frame:

 UIImageView* imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; imgView.image = [UIImage imageNamed:@"image.png"]; 

(and don't forget [imgView release]; somewhere)

+21
source share

UIImage has no framework. It has only width and height. If you want to place it in your view, you must create a UIImageView

 UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(12,12,123,123)]; imageView.image = image; // image - your UIImage 
+6
source share

All Articles