How to Create Facebook Style Fixed Status Bar

How to create Facebook style fixed Status bar?

Dean Edwards' "IE7" JavaScript library may help. It fixes position: fixed in IE6.

Fixed Bar like facebook/wibiya with jquery/YUI/prototype

There is a tutorial for exactly what you want here (part 1 and part 2)

UPDATE: BOTH LINKS ARE NOW DEAD! :(

Fixed status bar conflicts with slide out menu

Edited based on comments:

If you add a div inside of your nav, you can add a margin-left to that inner div when the menu is open. This jsfiddle now has the menu button still visible when the side menu opens.

I added a variable for the toolbar in Menu.prototype._init and used .inner.is-active{ padding-left:300px; } to pad the contents inside the fixed nav. You cannot add a margin or padding to the fixed element without it extending beyond the side of the page.

https://jsfiddle.net/Lz9fqvy8/

Original Answer

=====================================

If you let the content hide below your slide out menu, the toolbar will stay in place. To accomplish this I removed the translateX from the .site-wrap.has-push-left.

https://jsfiddle.net/hg9038vd/

You can also replace the translateX with a margin-left:300px and the toolbar will not push down.

https://jsfiddle.net/m5xcq3zf/

Fixed Status bar and hidden Navigation bar

The easiest way to solve this is in two parts, removing the navbar and then making the status bar transparent.

1 - Removing the navbar

To remove the navbar, create a new style on the styles.xml file under the values folder that inherits from Theme.AppCompat.Light.NoActionBar.

https://i.stack.imgur.com/UdMLQ.png

Then on the manifest.xml file change the theme of the Activity to your custom style.

Edited manifest

With this the navbar will be removed, but the status bar will still be grayed out.

2 - Making the status bar transparent

You can follow this tutorial to make the status bar transparent: Transparent Status Bar

Or just add the following to the onCreate method of your Activity:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}

Sample Image

With this you can expect an App style similar to the one in the next picture:

Sample Image

3 - Removing the status bar completely

To hide the status bar completely, add this on your onCreate method:

View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

You can read more on this at Hiding the status bar

Result:

Sample Image

4 - Removing the navigation Bar

You can find a solution to this at the Android Developer site Hiding the navigation bar

Basically just add this to your onCreate:

View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

How can I create a status bar with bootstrap?

A fixed-bottom Navbar seems right. There's even a Bootstrap Example that demonstrates this.

how iphone facebook app make the navigation bar fixed

this is what worked for me:

toolBar = [[UIView alloc]initWithFrame:CGRectMake(105, 20, 105, 44)];
notificationsBtn = [UIButton buttonWithType:UIButtonTypeCustom];
messagesBtn = [UIButton buttonWithType:UIButtonTypeCustom];

[notificationsBtn setImage:[UIImage imageNamed:@"notifications-icon.png"] forState:UIControlStateNormal];
[notificationsBtn setFrame:CGRectMake(35, 0, 35 , 44)];
[notificationsBtn addTarget:self action:@selector(showNotifications:) forControlEvents:UIControlEventTouchUpInside];

[messagesBtn setImage:[UIImage imageNamed:@"messages-icon.png"] forState:UIControlStateNormal];
[messagesBtn setFrame:CGRectMake(70, 0, 35 , 44)];
[messagesBtn addTarget:self action:@selector(showMessages:) forControlEvents:UIControlEventTouchUpInside];

[toolBar addSubview:notificationsBtn];
[toolBar addSubview:messagesBtn];

[_window.rootViewController.view addSubview:toolBar];

iOS 8: web app status bar position and resizing problems

Apple fixed this bug in iOS 8.3 beta 1



Related Topics



Leave a reply



Submit