You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: docs/core-concepts/angular-bootstrap.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,10 @@ One of our major design goals here is to provide virtually the same interface as
27
27
Application options in NativeScript are configured at the time the application boots. That could be problematic for Angular apps since the usual application start up process is hidden inside the `platformNativeScriptDynamic` black box. To allow for customizations, we introduced an additional `AppOptions` parameter to the platform initialization function that lets you preconfigure certain aspects of your application behavior. At the moment those are:
28
28
29
29
*`cssFile`: overrides the path to the file containing global CSS rules that are applied to all visual objects in the application. The default path is `app.css`.
30
-
*`startPageActionBarHidden`: a boolean setting controlling whether your app will display the action bar on startup. The default setting is platform-specific: it displays the action bar on Android and hides it on iOS.
30
+
*`createFrameOnBootstrap`: In cases where your application **don't use `page-router-outlet`** , you will not get the default `Page` and `Frame`, which means you will not be able to inject them in your components or show the `ActionBar`. There is special `createFrameOnBootstrap` boolean option you can pass on bootstrap to make things as before 4.0.0:
The article describes how to use the ActionBar component in a non-Angular NativeScript application as well as some iOS and Android specifics. All described scenarios are demonstrated with the appropriate code snippet.
13
-
14
-
*[Defining The ActionBar](#defining-the-actionbar)
15
-
*[Title](#title)
16
-
*[Setting the Title Text](#setting-the-title-text)
17
-
*[Using a Custom Title View](#using-a-custom-title-view)
18
-
*[Using Custom View in Action Items](#using-custom-view-in-action-items)
19
-
*[Setting the App Icon for Android](#setting-the-app-icon-for-android)
20
-
*[Navigation Button](#navigation-button)
21
-
*[iOS Specifics](#ios-specifics)
22
-
*[Android Specifics](#android-specifics)
23
-
*[Action Items](#action-items)
24
-
*[Positioning](#positioning)
25
-
*[Setting Icons](#setting-icons)
26
-
*[How To](#how-to)
27
-
*[Showing or Hiding the ActionBar](#showing-or-hiding-the-actionbar)
The `ActionBar` is the NativeScript common abstraction over the Android ActionBar and iOS NavigationBar.
12
+
The article describes how to use the ActionBar component in a non-Angular NativeScript application as well as some iOS and Android specifics. All described scenarios are demonstrated with the appropriate code snippet. The `ActionBar` is the NativeScript common abstraction over the Android ActionBar and iOS NavigationBar.
34
13
35
14
## Defining The ActionBar
36
15
{% nativescript %}
@@ -41,7 +20,7 @@ Here is how to define the ActionBar inside your page:
41
20
<ActionBartitle="My ActionBar"/>
42
21
</Page.actionBar>
43
22
44
-
<!--page content ... -->
23
+
<!--Page content ... -->
45
24
</Page>
46
25
```
47
26
We will include only the `ActionBar` tag in the rest of the code-snippets in this article.
@@ -53,11 +32,7 @@ To define the ActionBar include the `ActionBar` tag inside a component template:
53
32
```
54
33
If more than one component defines an `ActionBar` - the last definition will be respected. You can also [add items to the current ActionBar](#adding-actions-to-existing-actionbar).
55
34
56
-
>Note: To show the ActionBar on the initial page of your application use the `startPageActionBarHidden: false` app option when bootstrapping the application.
>Note: To hide the ActionBar on the initial page of your Angular application use the `actionBarHidden` boolean property while accesing the current `Page` instance.
61
36
62
37
{% endangular %}
63
38
@@ -337,8 +312,43 @@ Values for `ios.systemIcon` are numbers from the [`UIBarButtonSystemItem`](https
337
312
### Showing or Hiding the ActionBar
338
313
339
314
You can explicitly control the visibility of the `ActionBar` by setting the `actionBarHidden` property of the `Page`.
315
+
{% nativescript %}
316
+
317
+
Hidng the `ActionBar` via XML.
318
+
```XML
319
+
<PageactionBarHidden="true"loaded="onPageLoaded">
320
+
</Page>
321
+
```
322
+
Hidng the `ActionBar` via code-behind (TypeScript).
323
+
```TS
324
+
exportfunction onPageLoaded(args:EventData) {
325
+
const page = <Page>args.object;
326
+
page.actionBarHidden=true;
327
+
}
328
+
329
+
```
330
+
{% endnativescript %}
340
331
{% angular %}
341
-
You can inject a reference to the current `Page` in the constructor of your component using the Angular DI.
332
+
You can inject a reference to the current `Page` in the constructor of your component using the Angular Dependency Injection (DI).
In **Android**, the application bar is visible by default and shows the name of the application as title. The navigation button is visible only when it is explicitly defined in the application.
0 commit comments