作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
目前我在 iPhone 应用程序中工作,使用两个按钮,然后我将图像设置为按钮 1 和按钮 2,然后我尝试将图像从按钮 1 拖到按钮 2,是否可以这样做?请帮助我
提前致谢
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]
最佳答案
关于iphone - 如何将图像从一个按钮拖到 iPhone 中的另一个按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12565637/
我是一名优秀的程序员,十分优秀!