I'm trying to implement a simple text animation in a custom UITableViewCell without having to go into editing mode which automatically brings up the delete button on the right. What I'm trying to accomplish is that when the label is updated by a button within the UITableviewcell, the text in the label is updated but with some smooth animation like sliding to the right since the updated text is prepended to the string. Any sample code would be great. thanks
我正在尝试在自定义UITableViewCell中实现一个简单的文本动画,而不必进入编辑模式,该模式会自动调出右侧的删除按钮。我想要实现的是,当UITableviewcell中的按钮更新标签时,标签中的文本会更新,但会有一些平滑的动画,例如向右滑动,因为更新的文本会预先添加到字符串中。任何示例代码都会很棒。谢谢
1 个解决方案
#1
0
I'm assuming the text is in a UILabel, which is a subclass of UIView, and therefore can be animated using core animation:
我假设文本位于UILabel中,它是UIView的子类,因此可以使用核心动画进行动画处理:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[myTextLabel setText:newText];
[UIView commitAnimations];
#1
0
I'm assuming the text is in a UILabel, which is a subclass of UIView, and therefore can be animated using core animation:
我假设文本位于UILabel中,它是UIView的子类,因此可以使用核心动画进行动画处理:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[myTextLabel setText:newText];
[UIView commitAnimations];