gpt4 book ai didi

iphone - 如何将图像从一个按钮拖到 iPhone 中的另一个按钮?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:48:36 24 4
gpt4 key购买 nike

目前我在 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]

最佳答案

您可以从this demo获得引用项目。

非常好。

还有一个link is here

关于iphone - 如何将图像从一个按钮拖到 iPhone 中的另一个按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12565637/

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