1 Preface
It is difficult to control the size of images displayed to users.
2. code example
Zyviewcontroller. M:
@ Synthesize myimageview;-(void) viewdidload {[Super viewdidload]; // do any additional setup after loading the view, typically from a nib. uiimage * MacBook = [uiimage imagenamed: @ "apple.png"]; // myimageview = [[uiimageview alloc] initwithimage: MacBook]; // do not change the image length/width ratio myimageview = [[uiimageview alloc] initwithframe: Self. view. frame]; // adapt the image to the entire View window myimageview. image = MacBook; myimageview. center = self. view. center; [self. view addsubview: myimageview];}
Result of maintaining the original proportion:
Full Screen running result:
3 conclusion
The above is the simple usage of uiimageview, which will be helpful to you.
Demo download: http://download.csdn.net/detail/u010013695/5297466