的代码是非常基本的:的UIView动画不起作用
UIImageView *testView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)];
[self.view addSubview:testView];
[testView setImage:[UIImage imageNamed:@"button.png"]];
[UIView animateWithDuration:100
animations:^{testView.center = CGPointMake(140,350);}
completion:^(BOOL finished){NSLog(@"animation finished");
}
];
不知怎么动画只是将无法正常工作。图像只显示在结束位置。 NSLog消息确实显示。
有谁知道什么可能会失败的动画?
非常感谢你。
我不知道100秒意。确保您已将button.png添加到您的项目中。我只是复制你的代码并用10秒进行测试,没有问题。 – HMHero 2014-05-11 21:41:13