Steroids Views

Steroids Views


View

steroids.view represents the current view being shown on the device's screen. The methods and objects below are currently only available when the view is displaying a steroids.views.WebView object.

Methods

Objects


Views

In the Steroids Runtime you can have multiple native-wrapped webviews executing at the same time, each displaying its own HTML document. A steroids.views.WebView is an object that represents a single webview. These webviews can be grouped and controlled with Steroids's native navigation controllers. There are three ways to use a steroids.views.WebView object:

Furthermore, your app has a root WebView configured via the steroids.config.location property in the file config/application.coffee. If you have tabs enabled, each tab has its own root WebView, defined by the steroids.config.tabBar.tabs array. The root WebView can never be popped with steroids.layers.pop. See the config/application.coffee Guide for more information.

Objects


Navigation bar

The current view (steroids.view) can have a navigation bar set at its top. This reduces the vertical space reserved for the view.

The left side of the navigation bar is reserved for the native back button which allows the user to navigate through the steroids.layers native navigation stack. The back button title will be "Back" by default, or the navigation bar title configured in the preceding steroids.views.*.

On iOS, the navigation bar appears automatically with steroids.layers.push, but can be set so that it doesn't appear with an option. On Android, steroids.layers.push doesn't show the navigation bar by default.

The navigation bar includes:

  • The back button on the left side, visible only if at least one layer is pushed to steroids.layers.
  • An optional title.
  • Optional steroids.buttons.NavigationBarButtons on the right and the left side. (Only one right side button is supported on Android).

Methods

Debug methods

Deprecated methods

In favor of Pixate's native CSS, we do not recommend the use of steroids.view.navigationBar.setAppearance anymore, as it clashes badly with the native styles.

Objects


Initial View

A namespace for methods and properties related to the Intial View of the app.

Description

The Intial View is a special WebView that is shown before the rest of the app is loaded. It can be effectively used for e.g. session management. The Initial View needs to be defined in config/application.coffee – read more in the Initial View guide.

Methods


Layers

Represents the current navigation stack and provides methods to present views in a hierarchical fashion.

Methods


Application State

To find out what the state of the application is regarding views, modals and drawers, the method getApplicationState may be used.

Methods