【发布时间】:2018-09-12 15:55:48
【问题描述】:
我正在尝试从UITableViewCell 获取动画(保存有关用户的信息,带有个人资料图片),方法是从此扩展用户的个人资料图片:
//////////////////
到这个
//////////////
它可以工作,但问题是动画不知何故从屏幕的一角开始,而不是从UITableViewCell 中的圆形图像开始。
func handlePictureTap(conversationTableCell: ConversationTableCell) {
guard let cellIndexPath = self.conversationsTableView.indexPath(for: conversationTableCell) else { return }
transitionDelegate.openingFrame = self.frameForCellAtIndexPath(cellIndexPath)
let userProfileViewController = UserViewController(nibName: "UserViewController", bundle: nil)
userProfileViewController.recentProfileProtocol = self
userProfileViewController.transitioningDelegate = transitionDelegate
userProfileViewController.modalPresentationStyle = .overCurrentContext
userProfileViewController.userProfileName = conversationTableCell.conversationName.text!
userProfileViewController.userProfileImage = conversationTableCell.conversationPicture.image
self.present(navEditorViewController, animated: true, completion: nil)
}
还有 frameForCellAtIndexPath 的函数。
func frameForCellAtIndexPath(_ indexPath: IndexPath) -> CGRect {
let cell = self.conversationsTableView.cellForRow(at: indexPath) as! ConversationTableCell
let profileImageFrame = cell.conversationPicture.frame
return profileImageFrame
}
我无法为其获取与整个屏幕相关的正确帧,以便我的动画从单元格的个人资料图片开始。
欢迎提出建议
【问题讨论】:
-
感谢 Nitish 的编辑。由于分数低,无法直接添加图片:)
标签: ios swift uitableview popup expand