Note that there are some explanatory texts on larger screens.

plurals
  1. POviewWithTag can Use limited Time
    primarykey
    data
    text
    <p>I have 3 UIImageView as Thumbnails with tags: 1, 2, 3.</p> <p>The following method:</p> <pre><code>- (IBAction)showImage:(UIGestureRecognizer *)sender { if (sender.view.layer.borderColor != [UIColor redColor].CGColor) { sender.view.layer.borderColor = [UIColor redColor].CGColor; UIImageView *showFullImage = (UIImageView *)[self.view viewWithTag:sender+10]; [self.view addSubview:showFullImage]; showFullImage setTag:sender+20; showFullImage.hidden = NO; } else { sender.view.layer.borderColor = [UIColor whiteColor].CGColor; UIImageView *hideFullImage = (UIImageView *)[self.view viewWithTag:sender+20]; [hideFullImage removeFromSuperView]; hideFullImage.hidden = YES; } </code></pre> <p>So, as you can see, I have 3 <code>UIImageView</code> small, thumbnails, with whiteBorderColor. Also I have created and added to superView another 3 Images Full Size, same frame, and following tags: 11, 12, 13 also those images are hidden.</p> <p>Now, I use the above code for this idea:</p> <p>When I touch one of those 3 thumbnails, the borderColor will be red, and the hidden Full Size image which has tag = thumbnail.tag + 10, will be Visible. If I press again the same thumbnail image, what now has red borderColor, the Full Size image will be hidden, and the border will be white.</p> <p>The code works, but my problem is: I can show and hide each Full Size image ONLY Twice.</p> <p><strong>THE IDEA IS THAT THUMBNAILS SHOULD WORK LIKE UIButton with pressed and normal states.</strong></p> <p>I don't want to use UIButtons.</p> <p>Thanks</p>
    singulars
    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.
    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