删除 UIButtons setBackroundImage Monotouch
我正在尝试删除已加载到按钮中的图像
button1.SetBackgroundImage(null, UIControlState.Normal);
,但出现错误,因为我无法将其设置为空,这是我可能想到清除它的唯一方法。有人对如何做到这一点有建议吗?
我尝试过执行 FromFile("", Controlstate.Normal),还创建一个 UIImage 并将其设置为 null,然后设置它等。出于某种原因,我可以将 UIImage 的图像设置为 null,但我无法设置按钮上的背景。
谢谢!
I'm trying to remove the images that I've loaded into buttons using
button1.SetBackgroundImage(null, UIControlState.Normal);
and I get an error because I can't set it to null and thats the only way I could possibly think of clearing it. Does anyone have suggestions on how to do this?
I've tried doing a FromFile("", Controlstate.Normal), also creating a UIImage and setting that to null and then setting it etc. For some reason I can set the image of a UIImage to null but I can't set the background on the on the button.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你能不能把按钮换成一个没有背景图像的新按钮?
can you not just swap the button out with a new one with no bg image?
创建一个空图像并使用它。
Create an empty image and use that instead.