साथ कार्य करना। मैं अक्षरों को दिखने की कोशिश कर रहा हूं जैसे उन्हें स्क्रीन के शीर्ष से छोड़ा जा रहा है, इसके बाद अच्छे प्रतिकृतियां कम हो जाएंगी जो कम और कम दिखाई देगी। मैंने इस प्रभाव को करने में कामयाब रहा है लेकिन पूरी तरह से नहीं।मैं CAReplicatorlayer, CATextLayer और बहुत ही बुनियादी एनिमेशन के साथ एक शांत पाठ प्रभाव पैदा करने की कोशिश कर रहा है CAReplicatorLayer
अभी तक यह है कि मैं क्या मिल गया है है:
- दोहराया परतों अंतिम बिंदु में शुरू कर रहे हैं:
CATextLayer *messageLayer = [CATextLayer layer]; [messageLayer setForegroundColor:[[UIColor blackColor] CGColor]]; [messageLayer setContentsScale:[[UIScreen mainScreen] scale]]; [messageLayer setFrame:CGRectMake(0, 0, 40, 40)]; [messageLayer setString:@"A"]; CAReplicatorLayer *replicatorX = [CAReplicatorLayer layer]; //Set the replicator's attributes replicatorX.frame = CGRectMake(0, 0, 40, 40); replicatorX.anchorPoint = CGPointMake(0,0); replicatorX.position = CGPointMake(0, 0); replicatorX.instanceCount = 9; replicatorX.instanceDelay = 0.15; replicatorX.instanceAlphaOffset = -0.1; replicatorX.zPosition = 200; replicatorX.anchorPointZ = -160; [replicatorX addSublayer:messageLayer]; [self.view.layer addSublayer:replicatorX]; messageLayer.position = CGPointMake(40, 400); CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position.y"]; animation.fromValue = [NSNumber numberWithInt:0];; animation.toValue = [NSNumber numberWithInt:400]; animation.duration = 3; [messageLayer addAnimation:animation forKey:@"s"];
मैं दो समस्याएं हैं।
- जब मुख्य परत अपने अंतिम एनिमेटेड बिंदु तक पहुँचने एनिमेशन बंद हो और दोहराया परतों उनकी एनीमेशन पूर्ण नहीं कर सकता।