0

我需要一个可滚动的 CATextLayer 来显示一个 NSAttributedString。有没有办法混合两个图层,或者向 CATextLayer 添加滚动或在 CAScrollLayer 中显示文本?

对不起,如果问题不是很准确。谢谢!

编辑:我还没有看到 CALayer 是可滚动的。对不起!

4

2 回答 2

1

尝试将此添加到您的示例中以编程方式滚动图层:

- (void)scroll {
    [scrollLayer scrollToPoint:scrollPoint];
    scrollPoint.x += 10;
    [self performSelector:_cmd withObject:nil afterDelay:0.1];
}

并在初始化方法的末尾添加:

scrollPoint = CGPointMake(0, 0);
[self scroll];
于 2013-04-22T13:07:09.623 回答
0

CALayer(和 CATextLayer)可以滚动

于 2011-11-30T16:15:07.830 回答