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
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
Describe the bug
We have a directive to apply some styles programmatically (ex. backgroundColor, backgroundImage, ...) and shadow (using the plugin above) based on a JSON downloaded from a server. On Android to get the styles working we have to use a setTimeout with a non-empty time value (ex. setTimeout() => ... , 2) ).
The problem is only on Android when using the back button. Returning to a previous created page made all set styles lost. To avoid this I listen to router changes and, inside a setTimeout, I change the backgroundColor of the HTMLElement first to '' " then to its previous value. This seem to trigger the redraw of the page.
This solution causes flickering and, if the background is a remote image, the re-download of it, so it's far from perfect.
To Reproduce
On Android, apply a directive to a StackLayout component, setting the backgroundColor style of the HTMLElement. Then navigate to a page and return back.
Expected behavior
The programmatic styles are not lost on back, and backgroundImages are not reloaded like on iOS
Sample project
Currently I don't have time to set one up, I'll try in the weekend
Additional context
The text was updated successfully, but these errors were encountered:
pianetarosso
changed the title
Navigation back loses styles applyied programmatically
Android - Navigation back loses styles applyied programmatically
Jul 31, 2020
In addition the back stack is completely broken in my case. when I navigate to a page then I press back I see wrong styles, then when I press back the app again navigates to the page I was in and when I press back again I see the first page with correct styles.
I'm using "@nativescript/angular": "10.0.0" and "@nativescript/core": "rc"
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
We have a directive to apply some styles programmatically (ex. backgroundColor, backgroundImage, ...) and shadow (using the plugin above) based on a JSON downloaded from a server. On Android to get the styles working we have to use a setTimeout with a non-empty time value (ex.
setTimeout() => ... , 2)
).The problem is only on Android when using the back button. Returning to a previous created page made all set styles lost. To avoid this I listen to router changes and, inside a setTimeout, I change the backgroundColor of the HTMLElement first to '' " then to its previous value. This seem to trigger the redraw of the page.
This solution causes flickering and, if the background is a remote image, the re-download of it, so it's far from perfect.
To Reproduce
On Android, apply a directive to a StackLayout component, setting the backgroundColor style of the HTMLElement. Then navigate to a page and return back.
Expected behavior
The programmatic styles are not lost on back, and backgroundImages are not reloaded like on iOS
Sample project
Currently I don't have time to set one up, I'll try in the weekend
Additional context
The text was updated successfully, but these errors were encountered: