使用UIViewAnimation旋转UITableViewCell的UIImageView(我的应用程序挂起!!)
我将此UITableViewCell设置在表中,并将left imageView设置为图像。现在,我只想在用户选择单元格(别名行)时连续旋转此图像。我可以设置单元格图像视图的动画以旋转,但一旦我这样做,应用程序就会停止响应用户输入。换句话说,应用程序挂起,图像按应有的方式旋转。下面是相关的代码片段使用UIViewAnimation旋转UITableViewCell的UIImageView(我的应用程序挂起!!),uitableview,uiimageview,rotation,freeze,uiviewanimation,Uitableview,Uiimageview,Rotation,Freeze,Uiviewanimation,我将此UITableViewCell设置在表中,并将left imageView设置为图像。现在,我只想在用户选择单元格(别名行)时连续旋转此图像。我可以设置单元格图像视图的动画以旋转,但一旦我这样做,应用程序就会停止响应用户输入。换句话说,应用程序挂起,图像按应有的方式旋转。下面是相关的代码片段 (void)tableView:(UITableView*)aTableView DidSelectRowatineXpath:(NSIndexPath*)indexPath{ ... [NSThr
- (void)tableView:(UITableView*)aTableView DidSelectRowatineXpath:(NSIndexPath*)indexPath{ ... [NSThread detachNewThreadSelector:@selector(rotateImage)toTarget:self with Object:nil]
- (无效)旋转图像{
UITableViewCell*selectedCell=[self.tableView cellForRowAtIndexPath:[self.tableView indexPathForSelectedRow]]
[UIView beginAnimations:@“循环动画”上下文:nil];
//如果您愿意,这里还有其他动画选项,持续时间可以是任何内容,而不仅仅是3
[UIView动画持续时间:10延迟:0选项:UIView动画选项重复动画:^{
//在你的图像上,在这个块中,对你将要返回的单元格进行旋转。
selectedCell.imageView.transform=CGAffineTransformMakeRotation(Kdegreestorarians(90));
}完成:无]
[UIView委员会];
}
[UIView animateWithDuration:10 delay:0
options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAllowUserInteraction
animations:^{
selectedCell.imageView.transform = CGAffineTransformMakeRotation(M_PI);
}
completion:NULL];