OpenThread
OpenThread

Reputation: 2094

How to make tableview's content displayed under a transparent navigation bar?

How to make tableview's content displayed under a transparent navigation bar?

Like this:In "Photos" app, albums displayed under navigation bar.

Special thanks

enter image description here

Upvotes: 1

Views: 768

Answers (4)

kmp3
kmp3

Reputation: 115

One way I have found to accomplish this is by shifting your tableview's superview up to have the origin at {0, 0}. However after researching more several people have said altering the superview (UIViewControllerWrapperView) is a bad idea. However I also have not found any information on why just changing the frame would create problems. I am shifting the superview right now and haven't found any problems related to it yet.

Upvotes: 1

Hashim MH
Hashim MH

Reputation: 1576

If you use _rootNavigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent; then set correct tableview frame thats it. If you are in xib dont forget to simulate the translucent navigation bar.

Upvotes: 4

iDev
iDev

Reputation: 23278

For making the navigation bar transparent alone, you can check this post, How to make a Navigation bar transparent and fade out like in the photo app in the iPhone

Also check this How to set the transparency color for Toolbar and Navigation bar using MonoTouch?

I am not sure whether you can add the table view behind the navigation bar. You might have to add it as a subview of self.parentViewController.view.

Another way to do this is by hiding navigation bar and using a transparent tool bar in place of that. This can be added on top of the current view. The only problem is with the back button. You might have to use custom button for that.

Upvotes: 0

Kanan Vora
Kanan Vora

Reputation: 2122

Might be you can set it like this:

[navigationBar setAlpha:0.5f];

Upvotes: 0

Related Questions