/ Published in: Objective C
Expand |
Embed | Plain Text
First a UIImage needs to be made, to make one with an image from the application bundle use this code: UIImage *myImage = [ UIImage imageNamed: @"myImage.png" ]; If you need to make an image from a URL you can do something like this: More info can be found about this technique here: http://idevkit.com/forums/tutorials-code-samples-sdk/3-one-line-uiimage-url.html Now that the UIImage has been made it needs to be put into a UIImageView. This is simply done with the -initWithImage: method: UIImageView *myImageView = [ [ UIImageView alloc ] initWithImage: myImage ]; You can then add the image view as a subview to any other view. You can also change the frame to resize the image.
You need to login to post a comment.
