UITableView滚动重置UIImageViews

时间:2015-01-06 11:04:55

标签: uitableview uiimageview

我在UIView上通过facebook pop动画了一些UIImageViews。 UIView顶部的UiTableView包含推文。不知何故,我的ImageViews在滚动时重新定位。我不确定它是否与Facebook pop相关,或者我如何设置tableview存在问题?

带有推文的UITableView是在我的控制器的viewDidLoad中以编程方式完成的

self.fireTweet = [[CustomUITableView alloc]initWithFrame:CGRectMake(/*160.0f*/self.MainView.frame.size.width, 200.0f, 320.0f, 340.0f)];
 [self.fireTweet registerClass:[TWTRTweetTableViewCell class]  forCellReuseIdentifier:TweetTableReuseIdentifierFire];
self.fireTweet.delegate = self;
self.fireTweet.dataSource = self;
self.fireTweet.layer.borderColor = [UIColor greenColor].CGColor;
self.fireTweet.layer.borderWidth = 2.0;
self.fireTweet.rowHeight = UITableViewAutomaticDimension;
self.fireTweet.estimatedRowHeight = 340;
...

这里有一些facebook流行相关的动画代码

POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPosition];
anim.springBounciness = 10.0;
anim.toValue = [NSValue valueWithCGPoint:CGPointMake((view.frame.size.width / 2.0) + x, (view.frame.size.height/2.0) + y) ];

//shrink
POPSpringAnimation *imgAnimShrink = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerSize];
imgAnimShrink.property = [POPAnimatableProperty propertyWithName:kPOPLayerSize];
imgAnimShrink.toValue = [NSValue valueWithCGSize:CGSizeMake(50, 50)];



[view pop_addAnimation:anim forKey:@"bottom"];

[view pop_addAnimation:imgAnimShrink forKey:@"imageShrink"];

1 个答案:

答案 0 :(得分:0)

自己想出来。只需关闭自动布局即可修复