A UIScrollView
包含5 UIView
s。基本上我想展開並摺疊它們,當用戶觸摸UIView
中的任何一個時。UIView框架在滾動時自動重置
代碼動畫globalPressReleasesView
擴大:
[UIView beginAnimations:@"Expand" context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[globalPressReleasesView setFrame:CGRectMake(globalPressReleasesView.frame.origin.x, globalPressReleasesView.frame.origin.y, globalPressReleasesView.frame.size.width, globalPressReleasesView.frame.size.height + [globalPressReleasesArray count]*105)];
[financialPressReleasesView setFrame:CGRectMake(financialPressReleasesView.frame.origin.x, financialPressReleasesView.frame.origin.y + [globalPressReleasesArray count]*105, financialPressReleasesView.frame.size.width, financialPressReleasesView.frame.size.height)];
[newOnCscView setFrame:CGRectMake(newOnCscView.frame.origin.x, newOnCscView.frame.origin.y + [globalPressReleasesArray count]*105, newOnCscView.frame.size.width, newOnCscView.frame.size.height)];
[latestEventsView setFrame:CGRectMake(latestEventsView.frame.origin.x, latestEventsView.frame.origin.y + [globalPressReleasesArray count]*105, latestEventsView.frame.size.width, latestEventsView.frame.size.height)];
[latestCaseStudiesView setFrame:CGRectMake(latestCaseStudiesView.frame.origin.x, latestCaseStudiesView.frame.origin.y + [globalPressReleasesArray count]*105, latestCaseStudiesView.frame.size.width, latestCaseStudiesView.frame.size.height)];
[scrollView setContentSize:CGSizeMake(scrollView.frame.size.width, scrollView.frame.size.height + [globalPressReleasesArray count]*105)];
[UIView commitAnimations];
廈門國際銀行的其他特性:
每個UIView
裁剪 scrollview.autoresize = YES
問題:
'globalPressReleasesView'完美展開,但當我滾動我的scrollview
。 globalPressReleasesView
幀自身重置爲在xib中定義的原始幀值。
有人可以猜測是什麼問題嗎?
一旦檢查scrollview委託方法 – Balu
是試過了,這是我如何知道,所有包含的'UIView'幀的值正在重置。 ' - (void)scrollViewDidScroll:(UIScrollView *)scrollView' – turtle
檢查globalPressReleasesView框架在這個方法中? – Balu