【问题标题】:How to scroll the text horizontally and vertically? Objective C如何水平和垂直滚动文本?目标 C
【发布时间】:2013-01-10 11:58:14
【问题描述】:

我有 UILabel 视图,我想以固定的持续时间将文本从右到左水平移动。我是新手,请帮助!谢谢!

【问题讨论】:

  • 你的意思是像股票标签一样吗?

标签: objective-c ios5 xcode4.2


【解决方案1】:

这样的东西应该可以正常工作:

CGPoint center = scrollLabel.center;
[UILabel beginAnimations:@"scroll" context:nil];
[UILabel setAnimationDuration:5.0]; // the time the animation should take
center.x -= 500; // whatever distance you'd like
[UILabel commitAnimations];

【讨论】:

  • 嘿,谢谢,我无法理解 wat @"scroll" 是……那是要滚动的文本吗??
  • @"scroll" 只是你想给动画起的名字。你可以称它为“fade”或“kowabunga”,但两者都没有多大意义。 ;)
猜你喜欢
  • 2014-01-09
  • 1970-01-01
  • 1970-01-01
  • 2017-01-01
  • 1970-01-01
  • 2020-08-17
  • 2015-05-31
  • 2013-11-30
  • 1970-01-01
相关资源
最近更新 更多