给button添加事件,调用的函数带参数,怎么传参数

2025-03-29 13:15:04
推荐回答(1个)
回答(1):

您好,很高兴为您解答。 以UIButton为demo UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(buttonX, buttonY, width, height)]; //给button添加点击事件,action参数中写入事件执行方法 [button addTarget:self action:@select...