0

I created a UIView which I want to display over my UITableView.

I add it by adding to the current view: [self.view addSubview:self.adBanner];

When I scroll the section headers will hover over top of this view.

Am I adding the view over table correctly or should I be adding it to a different view?

Girish
  • 4,692
  • 4
  • 35
  • 55
nazbot
  • 1,527
  • 2
  • 15
  • 23
  • Why add it 'over' the table rather than 'below' the table? – Wain May 23 '13 at 22:05
  • Do you want your view to scroll with the table view rows, or do you want your view to remain in a fixed position on the screen when the table view scrolls? – rob mayoff May 23 '13 at 22:31
  • No, I want the view to stay fixed in position - essentially I want to always display an ad banner over the view. – nazbot May 26 '13 at 18:36

2 Answers2

1

Have you trie the following?

[self.view insertSubview:self.adBanner aboveSubview:yourTableview];
WrightsCS
  • 50,551
  • 22
  • 134
  • 186
  • Unfortunately that didn't work. I was already calling the bring to front method and it has similar results.. – nazbot May 26 '13 at 18:35
0

Import quartzCore and set z-index of table view to -100 as given code below:-

#import <QuartzCore/QuartzCore.h>

[tableView.layer setZPosition:-100];
Prince Kumar Sharma
  • 12,591
  • 4
  • 59
  • 90