Mix CATextLayer et CAScrollLayer
-
25-10-2019 - |
Question
je besoin d'un CATextLayer Défilant pour afficher un NSAttributedString. Est-il possible de mélanger les deux couches, ou pour ajouter un rouleau à CATextLayer ou au texte d'affichage dans un CAScrollLayer?
Désolé si la question n'est pas très exact. Merci!
EDIT: Je n'ai pas vu que le CALayer est scrollable. Désolé!
La solution 2
CALayer (et CATextLayer) peut être défilée
Autres conseils
Essayez d'ajouter ceci à votre exemple pour faire défiler la couche programme:
- (void)scroll {
[scrollLayer scrollToPoint:scrollPoint];
scrollPoint.x += 10;
[self performSelector:_cmd withObject:nil afterDelay:0.1];
}
et ajouter ceci à la fin de la méthode initialize:
scrollPoint = CGPointMake(0, 0);
[self scroll];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow