Mix CATextLayer and CAScrollLayer

I need a scrollable CATextLayer to display a NSAttributedString. Is there any way to mix both layers, or to add a scroll to CATextLayer or to display text in a CAScrollLayer?

Sorry if the question isn't very exact. Thanks!

EDIT: I haven't seen that the CALayer is scrollable. Sorry!

Answers


Try adding this to your example to scroll the layer programmatically:

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

and add this at the end of the initialize method:

scrollPoint = CGPointMake(0, 0);
[self scroll];

Need Your Help

How do I change the directory where CVS in Eclipse asks me to create the known_hosts for SSH2?

eclipse ssh cvs

It keeps asking me to create the known_hosts file inside a network location I don't have access to. I need to change it to my computer's home directory (or somewhere else).

Why would a SQL MERGE have a duplicate key error, even with HOLDLOCK declared?

sql-server-2008 merge

There is a lot of information that I could find on SQL Merge, but I can't seem to get this working for me. Here's what's happening.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.