MonoTouch. Removing a specific UIImage UView from a ViewController

How to quickly find and remove a UIImageView from the ParentViewController.View.Subviews collection?

Right now I am comparing Image.Size, but it is slow and sometimes flickers. Image objects are not compared.

upd ... the cause of the flicker was what I messed up. I fixed it. However, comparing Image.Size does not seem like a very good idea.

+4
source share
1 answer

You can try the following:

Add a unique tag property (int) to your UIImageView :

myImageView.Tag = 100;

Then using this tag you can remove it from the supervisor:

ParentViewController.View.ViewWithTag(100).RemoveFromSuperview();

+5
source

Source: https://habr.com/ru/post/1384197/


All Articles