scrollview 与 父view
-(void)animationBlock
{
if (!isScrollTop) {
// self.hotCityView.hidden = YES;
[UIViewbeginAnimations:nilcontext:nil];
[UIViewsetAnimationDelegate:self];
// [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[UIViewsetAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIViewsetAnimationDelay:0.1];
[UIViewsetAnimationDuration:0.4];
TTLog(@"hotcityview x y %f%f",self.hotCityView.center.x,self.hotCityView.center.y);
TTLog(@"indexcityview x y %f%f",self.indexCityView.center.x,self.indexCityView.center.y);
self.indexCityView.center = indexcityViewCenter;
int row = (hotCityArray.count%4 > 0)?hotCityArray.count/4 + 1:hotCityArray.count/4;
self.indexCityView.frame =CGRectMake(0, self.hotCityView.frame.origin.y + 39, self.indexCityView.frame.size.width, self.indexCityView.frame.size.height + row *41);
//self.indexCityView.frame =CGRectMake(0, self.indexCityView.frame.origin.y -2, self.indexCityView.frame.size.width, self.indexCityView.frame.size.height + row *41);
// TTLog(@"indexcityview y %f",self.indexCityView.frame.size.height + self.hotCityView.frame.origin.y + self.hotCityView.frame.size.height);
//self.cityScrollView.frame = CGRectMake(0, self.cityScrollView.frame.origin.y, 320, self.indexCityView.frame.size.height - self.indexView.frame.size.height);
[UIViewcommitAnimations];
isScrollTop = YES;
}
}
content size, frame, 小黑点,
// self.indexCityView.center = indexcityViewCenter;
int row = (hotCityArray.count%4 > 0)?hotCityArray.count/4 + 1:hotCityArray.count/4;
self.indexCityView.frame =CGRectMake(0, self.hotCityView.frame.origin.y + 39, self.indexCityView.frame.size.width, self.indexCityView.frame.size.height + row *41);,这两句话 效果是一样的,一个设置 center,一个设置 frame,