4

So I am trying to create a search that returns a bunch of results to a UITableView. When the user selects one of the cells, I want to overlay a detail view of that result in a nice, concise window. This view needs to have some text, buttons and a photo. I was looking into hacking an alertview but read that that is generally frowned upon. I also looked at the HeadsUpUI example in the iphone SDK, but that didn't do exactly what I wanted. Does anyone have any examples how to overlay a custom view on top of a tableView? Any help would be greatly appreciated...

I have also tried doing something like this with no luck:

CGRect newSize = CGRectMake(0.0f ,0.0f, 320.f, 400.0f);
UIView *newView = [[UIView alloc] initWithFrame:newSize];
[tableView addSubview:newView];
[tableView bringSubviewToFront:newView];
[newView release];

Also, if there is any way to blur out the rest of the view, that would be awesome. Any ideas? Thanks in advance!

gabaum10
  • 3,769
  • 3
  • 48
  • 89
  • And before you say "just push a view into the table", we currently do that but do not like the way the interface flows. There is just too much screen real estate on the iPad that it looks terrible. That's why we just want a smaller brief overlay. – gabaum10 Aug 25 '10 at 14:06
  • Here is an idea: is it possible to display a popover with a table view cell as the source?? That would work as well... – gabaum10 Aug 25 '10 at 15:21

3 Answers3

2

why not just use a custom view presented as a modal view..With iPad there are a few new styles of presentation, (see UIViewController reference) and it blurs/disallows clicking in the background. Another iPad specific option would be a UIPopoverController.

Jesse Naugher
  • 9,780
  • 1
  • 41
  • 56
0

Have yout thought about using two CALayers, a semi transparent white or black one that holds the blur effect and adding another for your custom data ?

You could use backgroundFilters for the backlayer to blur the underlying view.

Edit: Sorry, just read that the filters i'm thinking about are currently not supported for iOS ... but think about making the backlayer just semi transparent, might give a nice touch as well.

Gauloises
  • 2,046
  • 1
  • 13
  • 8
  • Right, well I just need to have some sort of subview appear overtop of the tableView. I am having a very difficult time getting that to happen. – gabaum10 Aug 25 '10 at 14:31
0

Thanks for the responses guys!

I actually decided to go with a dynamic popover that is created when the user clicks on a cell. That has the functionality I needed. I do think that tableView superview method would have worked if worse came to worse. Thanks again.

gabaum10
  • 3,769
  • 3
  • 48
  • 89