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