【发布时间】:2011-05-12 14:10:42
【问题描述】:
在视图加载后,在我的应用程序中,图像应该从左到右出现。
我在viewdidload 或viewwillappear 中编写此代码:
UIImage *image = [UIImage imageNamed:@"PG05(REV).jpg"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
for (int i=-1024; i<=0; i++) {
NSLog(@"i: %d",i);
sleep(5);
imageView.frame = CGRectMake(i,0, 1024, 768);
NSLog(@"done");
[self.view addSubview:imageView];
}
[imageView release];
但问题是,在加载视图之前,它执行上述代码而不是加载视图,因此看起来视图已加载并且静态图像在那里。 但我的要求是第一个视图完全加载,然后图像应该从左到右显示。
请帮帮我。
【问题讨论】:
标签: iphone objective-c ipad