目前我在 iPhone 应用程序中工作,使用两个按钮,然后我设置了 button1 和 button2 的图像,然后我尝试将图像从 button1 拖到 button2,可以这样做吗?请帮我
提前致谢
button1 = [UIButton buttonWithType:UIButtonTypeCustom];
[button1 setImage:[UIImage imageNamed:@"hearta.png"] forState:UIControlStateNormal];
button1.frame=CGRectMake(10, 60, 50, 50);
[button1 addTarget:self action:@selector(Button1Method) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button1];
button2 = [UIButton buttonWithType:UIButtonTypeCustom];
[button2 setImage:[UIImage imageNamed:@"club4.png"] forState:UIControlStateNormal];
button2.frame=CGRectMake(61, 60, 50, 50);
[button2 addTarget:self action:@selector(Button2Method) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button2]