/**
* 移动
*/
-(void)remove:(int)tag toTag:(int)tag2
{
//取要移动到的位置button
UIButton *mybutton = (UIButton *)[self.view viewWithTag:tag2];
//取点击的button
UIButton *mybutton1 = (UIButton *)[self.view viewWithTag:tag];
//点击button的图片
UIImage *myImage = mybutton1.currentBackgroundImage;
//把图片赋值给空的button
[mybutton setBackgroundImage:myImage forState:normal];
//原先有图片的button背景图片赋值为空
[mybutton1 setBackgroundImage:nil forState:normal];
}
时间: 2024-10-05 21:49:54