单触摸。从 ViewController 中删除特定的 UIImage SubView
如何快速从 ParentViewController.View.Subviews
集合中查找并删除 UIImageView
?
现在我正在比较 Image.Size,但它运行缓慢并且有时会闪烁。比较 Image 对象失败。
upd...闪烁的原因原来是我搞砸的其他一些东西。我解决了这个问题。尽管如此,通过 Image.Size
进行比较似乎并不是一个好主意
How to find and remove a UIImageView
from the collection of ParentViewController.View.Subviews
very quick?
Right now I'm comparing the Image.Size but it works slow and sometimes flickers. Comparing Image objects fails.
upd... the reason of the flickering turned out to be some other stuff I messed up. I fixed that. Still, comparing by Image.Size
doesn't seem like a very good idea
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试以下操作:
向您的
UIImageView
添加一个唯一的标记属性 (int):myImageView.Tag = 100;
然后,使用此标记,您可以将其从超级视图中删除:
ParentViewController.View.ViewWithTag(100).RemoveFromSuperview();
You can try this :
Add a unique tag property (int) to your
UIImageView
:myImageView.Tag = 100;
Then, with this tag, you can remove it from the superview:
ParentViewController.View.ViewWithTag(100).RemoveFromSuperview();