gpt4 book ai didi

iphone - 按钮操作没有响应 iphone

转载 作者:行者123 更新时间:2023-11-28 18:40:35 26 4
gpt4 key购买 nike

当我按下 nextButton 时,它是 UIBarButton。然后不执行相关操作。

UIButton *nextButton1=[UIButton buttonWithType:UIButtonTypeCustom];
[nextButton1 setBackgroundImage:[UIImage imageNamed:@"next.png"] forState:UIControlStateNormal];
[nextButton1 addTarget:self action:@selector(goToItems) forControlEvents:UIControlEventTouchUpOutside];
[nextButton1 sizeToFit];

UIBarButtonItem *nextButton=[[UIBarButtonItem alloc]initWithCustomView:nextButton1];
self.navigationItem.rightBarButtonItem=nextButton;

最佳答案

[nextButton1 addTarget:self action:@selector(goToItems) forControlEvents:UIControlEventTouchUpInside];

你传递的是UIControlEventTouchUpOutside,应该是UIControlEventTouchUpInside

关于iphone - 按钮操作没有响应 iphone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11360548/

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