Note that there are some explanatory texts on larger screens.

plurals
  1. POscrollView with UIImage respond touch
    primarykey
    data
    text
    <p>I'm using a simple code to add some images to my <code>UIScrollView</code>. Also I've implemented another code to detect touches on each image.</p> <p>Here is the code:</p> <pre><code>(void)handleSingleTap:(UIGestureRecognizer *)sender { int senderTagIs; senderTagIs = sender.view.tag; if (sender.view.layer.borderColor != [UIColor cyanColor].CGColor) { sender.view.layer.borderColor = [UIColor cyanColor].CGColor; UIImageView *showFullImage = (UIImageView *)[self.view viewWithTag:sender.view.tag+100]; [showFullImage setTag:sender.view.tag+200]; [self.view addSubview:showFullImage]; showFullImage.hidden = NO; NSLog(@"Show tag is: %i", sender.view.tag); } else { sender.view.layer.borderColor = [UIColor whiteColor].CGColor; UIImageView *hideFullImage = (UIImageView *)[self.view viewWithTag:sender.view.tag+200]; [hideFullImage setTag:sender.view.tag+100]; hideFullImage.hidden = YES; NSLog(@"Hide tag is: %i", sender.view.tag); } } </code></pre> <p>The above code, sets the border color to cyan and show my small images from <code>UIScrollView</code>, in another <code>UIImageView</code>.</p> <p>But my problem is, that I can't set the option to hide all images and set border color white for all images when one image is touched.</p> <p>Ex: If I touch the first image, then the code will work, my big UIImageView will show touched image and touched image from <code>UIScrollView</code> will get the cyan color for border, so far so good.</p> <p>Now, If I touch third image, my first image is shown, the color border is cyan, and so... I have to touch first image again to disable, but this is not what I want.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload