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];
Другие XIB свойства:
каждый UIView
обрезается scrollview.autoresize = YES
Проблема:
«globalPressReleasesView» отлично расширяется, но когда я прокручиваю свой scrollview
. globalPressReleasesView
frame возвращает себя к исходным значениям фрейма, определенным в xib.
Может кто-нибудь догадаться, в чем проблема?
один раз проверить методы делегата scrollview – Balu
да, это так, как я узнал, значения всех содержащихся '' кадров UIView '' сбрасываются. '- (void) scrollViewDidScroll: (UIScrollView *) scrollView' – turtle
проверить файл globalPressReleasesView в этом методе? – Balu