3
我想以编程方式选择表格视图中的行,然后呈现我的弹出窗口并让箭头指向单元格。通过UITableViewCell的UIPopoverController
此代码在表格没有滚动时工作正常,对于滚动表视图弹出窗口箭头位置不正确。
[self.EventsTableView selectRowAtIndexPath:indexPath
animated:YES
scrollPosition:UITableViewScrollPositionMiddle];
[popoverController presentPopoverFromRect:CGRectOffset(cell.frame, 0, cell.frame.size.height + self.EventsTableView.contentOffset)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionLeft
animated:YES];
感谢所有帮助
正确,良好的答案 只需: [popoverController presentPopoverFromRect:cell.bounds inView:细胞permittedArrowDirections:UIPopoverArrowDirectionLeft动画:YES]; 谢谢。 – Ashraf 2011-04-18 17:18:08
我仍然需要处理不可见的行! – Ashraf 2011-04-18 17:27:47
你的意思是当一个单元格以不可见的方式滚动时?在这种情况下,您可能希望使用'scrollToRowAtIndexPath:atScrollPosition:animated:'将其移动到视图中。 – 2011-04-18 23:23:18