gpt4 book ai didi

iphone - 在 iOS 中选择 UILabel 时推送到另一个 View Controller

转载 作者:行者123 更新时间:2023-11-28 22:34:36 24 4
gpt4 key购买 nike

当我从第一个 View Controller 中选择一个 UILabel 时,我试图从 Controller View 推送到另一个 View ,但我没有在连接检查器的左侧找到触发的 segue。

enter image description here

但是当我选择一个 UITableViewCell 时,我可以在左侧看到触发的 segue,如下图所示:

enter image description here

最佳答案

你将不得不使用 UIGesture 来实现这一点

UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];

[urLable addGestureRecognizer:singleTap];

-(void)handleSingleTap
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];

ViewController* viewController = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];

[self.navigationController pushViewController:viewController animated:YES];
}

关于iphone - 在 iOS 中选择 UILabel 时推送到另一个 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16439021/

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