uitableview - Create an image popup from an iOS tableview -


I would like to create a popup image such as the Twitter IOS app, where you click an image in a table view and then This image is fully enhanced so that you can see it better.

I tried the following:

  UITapGestureRecognizer * Tap Gastrar = [[UITAP JUSTICEER RAZZER ALOCK] Initvith Target: Self-Action: @Selector (Handset Tap :)]; // This is called the configurable function  

Then the function I call is this:

  - (zero) handlap: (UIGestureRecognizer *) Sender {CGPoint Tap Location = [Sender Location Inview: Self Televisions]; NSIndexPath * tapIndexPath = [self.tableView indexPhororoutPoint: taplocation]; Location * location = [self.fetchedResultsController objectAtIndexPath: tapIndexPath]; UIImage * Overlay image = [UIImage imageNamed: @ "Default.PNG"]; //default.png is just the placeholder for now UIImageView * overlayImageView = [[UIImageView alloc] initWithImage: overlayImage]; [Self.tableView addSubview: overlay image]; }  

This will pop up an image, but only at the top of the cell where the image was used.

Edit:

Many thanks for input I had my problem was that the uiimageview table was pinned on top of the view because CGRectMake 0,0, etc, etc. (0, 0, the top left). Instead, we need to set the image view in the area that is currently visible as

  - (zero) handleTap: (UIGestureRecognizer *) sender {CGPoint tap location = [sender location inview: self .tableView]; NSIndexPath * tapIndexPath = [self.tableView indexPhororoutPoint: taplocation]; CGFloat distanceformbottom = [self.tableView content offset] .y; UIImageView * imview = [[UIImageView alloc] initWithFrame: CGRectMake (0, distanceformbottom, self.view.frame.size.width, self.view.frame.size.height)]; Imview.backgroundColor = [UIColor blackColor]; Imview.image = @ "Default.PNG"; Imview.tag = 12345; // so that we can find it and dismiss it as impress.contentMode = UIViewContentModeScaleAspectFit; // Make sure the image is not extended [self.view addSubview: imview]; // subclass self.tableView.scrollEnabled = Add a; Self-action: @selector (dismissTap // Sure that the image is pop-out we can not scroll // Now adding a gesture identifier is sure that we can reject * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget Pop-up UIImageView UITapGestureRecognizer Lets make it :)]; Tap gastre.NumberOffSteps required = 1; TapGesture.cancelsTouchesInView = Yes; Imview.userInteractionEnabled = Yes; [Imavaued Estacierizer: Tap guester]; } - Dismiss (zero) Tape: (UIGestureRecognizer *) Sender {[self.view viewWithTag: 12345] removeFromSuperview]; Self.tableView.scrollEnabled = Yes; // Enable scrolling  

do this

 < Code> UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "Popup title" message: @ "This pop-up window / alert" is representative: cancel zeroTutton: @ "OK" other buttontitles: zero]; UIImageView * tempImageView = [[UIImageView alloc] initWithFrame: CGRectMake (20,20,50,50)]; TempImageView.image = [UIImage imageNamed: @ "abc.png"]; [Warning addSubView: tempImageView] [Warning Show];  

or you can download it from


Comments