我有一個MasterViewController,使用自定義模態segue,呈現一個詳細視圖。自定義模態動畫是來自GitHub上mluisbrown的LCZoomTransition。目前,我遇到了一個問題,導致我的tableview的單元格在選擇時向上移動。 UITableViewCell向上移動自定義segue出現/關閉
我不知道是什麼原因造成這種情況。我的代碼提交詳細視圖:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
EditViewController *edit = [[EditViewController alloc]init];
NSManagedObjectContext *mo = [_fetchedResultsController objectAtIndexPath:indexPath];
[edit setManagedObjectContext:mo];
id appDelegate= [[UIApplication sharedApplication] delegate];
self.managedObjectContext = [appDelegate managedObjectContext];
OweInfo *info = [_fetchedResultsController objectAtIndexPath:indexPath];
self.editView = edit;
self.editView.delegate = self;
self.editView.info = info;
edit.info = info;
edit.delegate = self;
edit.managedObjectContext = [appDelegate managedObjectContext];
self.editView.managedObjectContext = [appDelegate managedObjectContext];
[self performSegueWithIdentifier:@"pushToEdit" sender:self];
}
和我賽格瑞代碼:
if([segue.identifier isEqual: @"pushToEdit"]){
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
self.zoomTransition.sourceView = [self.tableView cellForRowAtIndexPath:indexPath];
// pass the custom transition to the destination controller
// so it can use it when setting up its gesture recognizers
[[segue destinationViewController] setGestureTarget:self.zoomTransition];
EditViewController *edit = segue.destinationViewController;
NSManagedObjectContext *mo = [_fetchedResultsController objectAtIndexPath:indexPath];
[edit setManagedObjectContext:mo];
id appDelegate= [[UIApplication sharedApplication] delegate];
self.managedObjectContext = [appDelegate managedObjectContext];
OweInfo *info = [_fetchedResultsController objectAtIndexPath:indexPath];
self.editView = edit;
self.editView.delegate = self;
self.editView.info = info;
self.editView.managedObjectContext = self.managedObjectContext;
edit.managedObjectContext = self.managedObjectContext;
edit.info = info;
edit.delegate = self;
}
任何人都知道可能會導致什麼呢?這是在iOS 8和Xcode的6
什麼是應該的樣子:
@meda它可能不會在gif中顯而易見,但UITableViewCell在轉換時向上移動(包括細節和背面),不正常 – 2014-10-17 01:58:27
但是,您是否得到實際的佈局錯誤或者是否意味着問題?我只能注意到右邊的UIBarButton移動了一點點 – meda 2014-10-17 02:01:01
@meda不,我意識到我的措辭在原評論中是錯誤的。 UITableViewCell向上移動,這不應該發生在這個轉換中。我會發佈一個應該發生的事情的GIF。 – 2014-10-17 02:01:56