Есть идеи, почему следующая анимация UIView работает только в одном направлении? - PullRequest
0 голосов
/ 04 августа 2011

У меня есть следующая анимация в конце моего метода делегата cellForRowAtIndex, который просто сдвигает все ячейки влево / вправо в зависимости от того, установлен ли у меня флаг псевдоредактирования:

[UIView beginAnimations:@"cell shift" context:nil];
[UIView setAnimationDuration:kEventActionViewAnimationDuration];

cell.eventName.frame = (self.pseudoEditing) ? kPseudoEditingFirstIndentedRect : kFirstLabelRect;
cell.eventLocationName.frame = (self.pseudoEditing) ? kPseudoEditingSecondIndentedRect : kSecondaryLabelRect;
cell.eventStartDate.frame = (self.pseudoEditing) ? kPseudoEditingThirdIndentedRect : kThirdLabelRect;
cell.eventStartEndTime.frame = (self.pseudoEditing) ? kPseudoEditingFourthIndentedRect : kFourthLabelRect;
cell.imageView.frame = (self.pseudoEditing) ? kImageViewIndentedRect : kImageViewRect;
cell.rsvpImageView.hidden = !self.pseudoEditing;

[UIView commitAnimations];


return cell;

Вот где объявлены константы:

#define kImageViewRect                          CGRectMake(10, 9.0, 60.0, 60.0)
#define kFirstLabelRect                         CGRectMake(80, 10.0, 220.0, 20.0)
#define kSecondaryLabelRect                     CGRectMake(80, 30.0, 220.0, 20.0)
#define kThirdLabelRect                         CGRectMake(80, 50.0, 220.0, 20.0)
#define kFourthLabelRect                        CGRectMake(180.0, 50.0, 110.0, 20.0)

#define kPseudoEditingFirstIndentedRect         CGRectMake(115.0, 10.0, 195.0, 20.0)
#define kPseudoEditingSecondIndentedRect        CGRectMake(115.0, 30.0, 195.0, 20.0)
#define kPseudoEditingThirdIndentedRect         CGRectMake(115.0, 50.0, 195.0, 20.0)
#define kPseudoEditingFourthIndentedRect        CGRectMake(200.0, 50.0, 110.0, 20.0)

Проблема в том, что он работает только в одном направлении при перемещении назад справа налево, а не из нормального состояния слева направо.

Есть идеи?

1 Ответ

0 голосов
/ 08 августа 2011

Оказывается, мой FetchedResultsController перезагружал таблицу сразу после начала анимации, которая ее отменяла.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...