gpt4 book ai didi

ios - 从 Tableview 自定义单元翻转到 UIViewController

转载 作者:行者123 更新时间:2023-11-29 03:26:32 24 4
gpt4 key购买 nike

我创建了一个自定义表格 View 单元格,该单元格显示在我的表格 View 中。当用户点击单元格时,我想创建一个到新 View Controller 的翻转水平过渡。如何使用 Core Animation 或 UIView 来做到这一点?

抱歉,我是新手,无法在任何地方找到正确的方法。

提前谢谢你。

最佳答案

我猜你正在谈论这个。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Create the next view controller.
DetailViewController *detail= [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
[detail setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentViewController:detail animated:YES completion:nil];

}

对于解雇:

-(IBAction)close:(id)sender
{
[self dismissViewControllerAnimated:YES completion:nil];
}

DetailViewController中编写此方法并调用此方法。

关于ios - 从 Tableview 自定义单元翻转到 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20391608/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com