如何在iPhone中添加移动文本 [英] How to add a moving text in iPhone

查看:57
本文介绍了如何在iPhone中添加移动文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加一些较长的文本,让我们讲一个故事,并希望它以向上的方式呈现.也就是说,它将显示在一个框中,并且文本将逐行移动以显示整个故事.因此,一条线从顶部跳出开箱即用,而另一条从底部跳出.就像HTML字幕的行为一样.

I want to add some text which is a long text lets say a story and I want it to be presented in a moving up fashion. That is it will be displayed in a box and the text will be moved line by line to show the whole story. So one line gets out of the box from top and other comes from the bottom. Like a HTML marquee behavior.

推荐答案

此方法可能有帮助(或没有帮助):

This method may help (or not):

- (void)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated

如果没有,只需制作一个大的UILabel并使用CABasicAnimation对其框架进行动画处理.

If not, just make a big UILabel and animate its frame using a CABasicAnimation.

这篇关于如何在iPhone中添加移动文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆