question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action bar title doesn't show when set dynamically

See original GitHub issue

Hi guys,

I recently migrated my {N} + Angular2 app to the 3.0 version of Nativescript, and it globally runs pretty smoothly, yet I encountered a strange behaviour that kind of annoys me.

Platform: I tried it on Android only, I didn’t have the time yet to try it on iOs

Version:

  • nativescript 3.1.2
  • tns core modules 3.1.0
  • tns android 3.1.1

Issue:

When I use a static ActionBar, it works just fine, the title shows so does the navigation button.

<ActionBar  width="100%" title="Action Bar title"> 

       <NavigationButton icon="res://ic_arrow_back_white_24"  (tap)="goBack()">                          
       </NavigationButton>

</ActionBar>

However, when I dynamically set the ActionBar title with angular, the UI doesn’t seem to be refreshing, and the title doesn’t show:

<ActionBar  width="100%" [title]="getActionBarTitle()"> 

       <NavigationButton icon="res://ic_arrow_back_white_24"  (tap)="goBack()">                          
       </NavigationButton>

</ActionBar>

The same problem occurs when I dynamically display (or not) certain elements of the action bar, even if the title is static:

<ActionBar  width="100%" title="Action Bar title"> 

       <NavigationButton icon="res://ic_arrow_back_white_24"  (tap)="goBack()">                          
       </NavigationButton>

       <ActionItem icon="res://ic_menu_white_24" text="Do something"  (tap)="doSomething()" *ngIf="isAndroid">                          
       </ActionItem>

</ActionBar>

I remember encountering the same kind of issue a long time ago in an old version of {N} while the Telerik dev team was trying to catch up with the daily releases of Angular 😃 so maybe it is a known issue, would you tell me if it is the case, and if there is a workaround ?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
quentinorcommented, Jul 19, 2017

Thanks, I will try to clone the project and test it, then I’ll get back to you with the results

0reactions
lock[bot]commented, Aug 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - ActionBar Title dynamically change with fragment
I was able to set the ActionBar title in my app by using the following code in my Fragment's onResume() ... @Override public...
Read more >
ActionBar in Android with Example - GeeksforGeeks
This pre-included ActionBar display title for the current activity that is managed by the AncdroidManifest.xml file.
Read more >
Working with the AppBar - Android Developers
The top app bar provides a consistent place along the top of your app window for displaying information and actions from the current...
Read more >
Dynamic Page | SAP Fiori Design Guidelines
Title (1): The title is located on the left of the header title bar, and is always visible. ... The dynamic page itself...
Read more >
Python and PyQt: Creating Menus, Toolbars, and Status Bars
If you run the application now, then you won't see any change on the GUI. That's because actions don't get displayed until they're...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found