I've got several images inside a scrollview and within my normal view. I'd like to check by means of an "if statement" if this image is inside my scrollvie开发者_如何学JAVAw or not.
i put my images inside the scroller with:
[scroller insertSubview:image belowSubview:self.view];
thanks in advance!
Have you tried:
[scroller.subviews containsObject:image];
?
If you want to add an image only if it is not added yet you can use tags. Each UIImageView should have a unique tag.
const int uniqueImageTag = 10001;
image.tag = uniqueImageTag;
if ([scroller viewWithTag:imageTag] == nil) {
    [scroller insertSubview:image belowSubview:self.view];
}
something like:
UIView *parent = [self.imageView superview];
if (parent == scroller) {
    //yep
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论