简体   繁体   中英

MonoTouch. Removing a particular UIImage SubView from ViewController

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

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();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM