以下是我的代码。我可以从我的 NSMutableArray 文件中加载所有图像文件,但它没有出现在我的屏幕上。我真的不知道为什么。如果有人可以帮助我,那就太好了。
提前致谢.....
UIImageView *bannerImages;
CGRect bannerFrame;
for (int photoCount = 0; photoCount < [imagesFileList count]; photoCount++)
{
NSLog(@"photoCount: %d",photoCount);
bannerImages = [[UIImageView alloc] initWithFrame:CGRectMake(0, 340, 320, 80)];
NSString *photoString = [NSString stringWithFormat:@"%@",[imagesFileList objectAtIndex:photoCount]];
NSLog(@"photoString are: %@",photoString);
bannerImages.image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:photoString]];
bannerFrame = bannerImages.frame;
bannerFrame.origin.y = self.view.bounds.size.height;
}
[UIView animateWithDuration:1.0
delay:1.0
options: UIViewAnimationTransitionCurlDown
animations:^{
bannerImages.frame = bannerFrame;
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];
[self.view addSubview:bannerImages];
[bannerImages release];
这是我的日志文件显示:
2013-05-30 15:09:19.595 Yangon Guide Map[5035:15803] photoCount: 0
2013-05-30 15:09:19.596 Yangon Guide Map[5035:15803] photoString are: adv01.png
2013-05-30 15:09:19.596 Yangon Guide Map[5035:15803] photoCount: 1
2013-05-30 15:09:19.596 Yangon Guide Map[5035:15803] photoString are: adv02.png
2013-05-30 15:09:19.596 Yangon Guide Map[5035:15803] photoCount: 2
2013-05-30 15:09:19.596 Yangon Guide Map[5035:15803] photoString are: adv03.png
2013-05-30 15:09:19.597 Yangon Guide Map[5035:15803] photoCount: 3
2013-05-30 15:09:19.597 Yangon Guide Map[5035:15803] photoString are: edupro.png
2013-05-30 15:09:21.598 Yangon Guide Map[5035:15803] Done!