【发布时间】:2013-09-17 23:09:11
【问题描述】:
我是 iphone 应用程序开发的新手,我正在尝试将图像添加到我的应用程序的开头。我创建了一个图像数组,在迭代时应该创建一个动画。
-(void)viewDidLoad
{
animation = [[UIImageView alloc] init];
animation.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"panda1.png"],
[UIImage imageNamed:@"panda2.png"],
[UIImage imageNamed:@"panda3.png"], nil];
animation.animationRepeatCount = 2;
animation.animationDuration = 2;
[animation startAnimating];
[self.view addSubview:animation];
[animation release];
//for loading the webpage at start up
NSString *urlAddress = @"http://projects.seng.uvic.ca/fatpanda/m/most_recent.php";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//load the request in the UIWebView
[webView loadRequest:requestObj];
}
我在最后发布动画的原因是因为我想删除最后一张图片,这样我就可以用 UIWebView 中的网站视图替换它,并在最后看到它。上面的代码可以编译,但是当我运行它时没有图像出现,但网站会出现。
任何帮助将不胜感激。
【问题讨论】:
标签: iphone objective-c ios animation