[英]Using UIImageView to make a app like iPhone's Photo Galerry
Please help me ! 请帮我 ! I make an app like a slide show with back, previous button to change Image one by one. 我制作了一个带有幻灯片的应用,如带有后退,上一步按钮的幻灯片,以逐一更改图片。 But when I using large image it crash. 但是,当我使用大图像时,它会崩溃。 Now I'm using 64 jpg pics , size~20kb/1pic. 现在,我正在使用64张jpg图片,大小约为20kb / 1pic。
Help me or I die ! 救救我或我死! (U can add nick hoangtuanfithou, please) code like that : (您可以添加nick hoangtuanfithou)这样的代码:
//Init Image Array //初始化图像数组
-(void)InitImageArray1
{
myAnimationImages1 = [[NSMutableArray alloc] init];
for ( int i = 0; i < 24; i++ )
{
NSAutoreleasePool *poolArray=[[NSAutoreleasePool alloc] init];
NSString *fileName = [NSString stringWithFormat:@"001 (%d)",i];
image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileName ofType:@”jpg”]];
[myAnimationImages1 addObject:image];
[poolArray release];
}
}
//Change Image self.mainImage.image = [self.myAnimationImages1 objectAtIndex:animationImageArrIndex]; //更改图片self.mainImage.image = [self.myAnimationImages1 objectAtIndex:animationImageArrIndex];
请参阅苹果的页面控制示例,或查看github上的滚动疯狂。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.