Interface Builder - How to resize images; image size not hard coded
I am learning how to design using Interface Builder in Xcode.
I have an existing app and the image开发者_JAVA百科s there I want to swap out with new ones. I spoke to the developer of my app who stated he did not hard code the image sizes. He said I can change the old image sizes to make the new ones fit properly by using Interface Builder.
I'm just swapping out one image with another using the same image names.
I am not sure where to re-size the width and height in Interface Builder. I wonder if anyone could offer a suggestion?
Did you build the interface with interface builder ? If so, just go to your xib, select the imageView the image is in and change it's size in the size tab (icon that looks like a rule)
If not, you have to change the size in code :
UIImage* myImage = ...
UIImageView* myImageView = [[[UIImageView alloc] initWithImage:myImage] autorelease]
myImageView.frame = CGRectMake (xPosition, yPosition, width, height);
精彩评论