Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView goes under translucent Navigation Bar

I am trying to have a transparent navigation bar in IOS 7 app. There is a full screen image in my application. I am also having a UITableView over that image. When I use the code below, image fits the screen as I want but UITableView goes under navigation bar.

in viewDidLoad

i use

self.navigationController.navigationBar.shadowImage = [UIImage new]; self.navigationController.navigationBar.translucent = YES; self.navigationController.view.backgroundColor = [UIColor clearColor]; 

it is being ok when I change to self.navigationController.navigationBar.translucent = NO; but then I lose transparency at navigation bar.

like image 655
birdcage Avatar asked Jun 28 '14 16:06

birdcage


People also ask

How do I get rid of the transparent navigation bar?

If you want to remove the opacity or transparency from the sticky navigation bar, just navigate to Theme Options -> General -> Additional CSS and copy/paste this code and save changes. You could also manipulate the opacity by altering the value “1” at the end of the CSS statement.

What is Uitableview in Swift?

A view that presents data using rows in a single column.


1 Answers

You could set the contentInsets of your tableView so it is initially below the navigation bar, but would scroll behind it (content would be overlapping)

self.tableView.contentInset = UIEdgeInsetsMake(44,0,0,0); 

Or you could offset the frame of the tableview. Then the scrolling content would be cut off below the navigation bar (which wouldn't look good, too)

like image 73
robert Avatar answered Oct 06 '22 16:10

robert