开发者

uitableview section headings going under nav bar when translucent on iOS3 only

I have pretty much the same issue as UITableView scrolling under the navigation bar but am posting this as a new question as I have some more specifics.

I have a full screen table (with sections) on a page with a black TRANSLUCENT navigation bar. This is within a UIViewController as I have some views overlaid on top so the table is created programatically thus;

- (void)viewDidLoad {

  [super viewDidLoad];

   self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
   self.navigationController.navigationBar.tintColor = nil;
   self.navigationController.navigationBar.translucent = YES;

   tableView = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] bounds] style:UITableViewStylePlain];
   tableView.delegat开发者_如何学JAVAe = self;
   tableView.dataSource = self;
   [tableView setContentInset:UIEdgeInsetsMake(44,0,0,0)];

   [self.view addSubview:tableView];
   [tableView release];
}

My problem is that although this works perfectly on iOS4 - in that the section headings butt up to the bottom of the translucent tableview as you scroll, on iOS3 the headings butt up to the bottom of the status bar instead :(

If I set the translucent property to NO, and remove the contentInset, it works identically and correctly in both operating systems.

Other than this, the behavior is correct, I DO want the contents of the table to scroll up behind the translucent navigation bar but I also want the section headings to stop beneath the nav bar so they are fully visible.

Is this something that should work the same for iOS3 and iOS4? Any ideas what I might be doing wrong?

Thanks Roger


try setting the frame frame of the tableview to self.view.bounds

My guess is that [[UIScreen mainScreen] bounds] is 480 pixels high (with the status bar).

p.s. as another option try setting self.wantfullscreenlayout = NO;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜