Programmatically set StackNavigationOptions

Hi,

I’m trying to programmatically set StackNavigationOptions (e.g. title, headerTitle, headerTruncatedBackTitle, headerTintColor, gesturesEnabled) using the “set StackNavigationOptions to” block, but it doesn’t work (no error). Any advice would be greatly appreciated. I’ve created a simple demo app to showcase the problem: https://x.thunkable.com/copy/bb1beb8bbeaa624fa1e8e0395e370b20

Cheers,

Guido

Hi,

blocks of navigators can not work by definition. Open a blank screen. There are blocks of navigators in the screen block, but they are not in the application. How can you change the property of that which is not?

Alex

Hi Alex,

In the example you provided, Button1.Text is “undefined” because Screen1’s StackNavigationOptions are empty/undefined by default. I’ve created another demo app that showcases the inconsistency when a screen’s title is set manually (using the Design View) vs. programmatically (using the “set StackNavigationOptions to” block). If I am not mistaken, the “set StackNavigationOptions” block is not working as expected. Take a look at https://x.thunkable.com/copy/6a360eb1290ff60603cd197b31e8fc08

Cheers,

Guido

Hi,

the parameters StackNavigationOptions cannot (should not) be undefined. After creating the navigator, it has a property - gesturesEnabled = false, as seen on the properties panel. Logically, it should be displayed in the “get StackNavigationOptions” block. But this is not happening. Properties are there, but they are undefined? This reduces the reliability and stability of the development in Thunkable X and can be a source of bugs.

You are right, “get StackNavigationOptions” does return parameters, but I could not set new parameters.

Regards, Alex

@rcd3 Thanks for finding that bug! I’ve added it to our internal bug queue.

-Mark