Теперь я просто создал пользовательский UILable и присвоил ему текст моей ячейки, а затем анимировал его .... вот код ...
в методе таблицы viewDidSelect, который я кодировал это ....
NSArray *visibleCells = [tableView visibleCells];
NSLog(@"the count %d",[visibleCells count]);
//UITableViewCell *aCell=[tableView cellForRowAtIndexPath:indexPath];
UITableViewCell *visiblecell=[tableView cellForRowAtIndexPath:indexPath];
NSLog(@"the count %@",aCell);
NSLog(@"The visible cell ::%@",visiblecell);
int i=0;
for (UITableViewCell *theCell in visibleCells)
{
if ([theCell isEqual:visiblecell])
{
selectedView.frame =CGRectMake( 0,i*(480/[visibleCells count]),320,50);
break;
}
i++;
}
anim=selectedView;
if (!anim)
return;
[self pathGenerate:anim];
и у меня есть отдельная функция анимации, просто я назвал это ...
- (void)pathGenerate:(UIView *)anim
{
// [self.tabBarController.tabBar insertSubview:(UIImageView*)[UIImage imageNamed:@"Coffee_smoke.png"] atIndex:0];
self.tabBarItem.image=nil;
UIBezierPath *movePath = [UIBezierPath bezierPath];
[movePath moveToPoint:anim.center];//-->down---->destinationPoint.center
[movePath addQuadCurveToPoint:CGPointMake(170, 420)
controlPoint:CGPointMake(200,10)];/* // 2nd phase //destinationPoint.center.x+200, destinationPoint.center.y-100)];*/
CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
moveAnim.path = movePath.CGPath;
moveAnim.removedOnCompletion = YES;
CABasicAnimation *scaleAnim = [CABasicAnimation animationWithKeyPath:@"transform"];
scaleAnim.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
scaleAnim.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)];
scaleAnim.removedOnCompletion = YES;
CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"alpha"];
opacityAnim.fromValue = [NSNumber numberWithFloat:1.0];
opacityAnim.toValue = [NSNumber numberWithFloat:0.1];
opacityAnim.removedOnCompletion = YES;
CAAnimationGroup *animGroup = [CAAnimationGroup animation];
animGroup.animations = [NSArray arrayWithObjects:moveAnim, scaleAnim, opacityAnim, nil];
animGroup.duration = 0.5;
[anim.layer addAnimation:animGroup forKey:nil];
// self.tabBarItem.image=[UIImage imageNamed:@"Coffee_smoke.png"];
}