Posted By

oppey on 05/23/11


Tagged


Versions (?)

画像のメモリ削減管理


 / Published in: Other
 

  1. viewImage.image = nil;//既に画像の読み込まれたUIImageView
  2. NSString *imageName = [NSString stringWithFormat: @"img2"];//新しくのせかえるUIImage
  3. NSString *imagePath = [[NSBundle mainBundle] pathForResource:imageName ofType:@"png"];
  4. img = [[UIImage alloc] initWithContentsOfFile:imagePath];
  5. viewImage.image = img;
  6. viewImage.contentMode = UIViewContentModeScaleAspectFill;
  7. [img release];

Report this snippet  

You need to login to post a comment.