Can the title of the view be toggled?

I want to disable the title on mobile devices. Is there a way to toggle the title?

Have you tried the following? In increasing order of complexity:

  1. <view title="">
  2. <view title="{my_view_variable}">
  3. <view title="{$:getTitle()}">

option 3 requires the function to be defined in the View JS as follows:

function getTitle() {
   if (someCondition) {
     return 'This View Title';
   }
   else {
     return 'That View Title';
   }
}

The concept behind 2 is "string interpolation" or "dynamic string formatting" and you can find more info here: https://docs.journeyapps.com/reference/container/xml-string-formatting#application

The concept behind 3 is "calling JS functions from XML" (it gets the value for the formatted string from a JS function) and there is more info here: https://docs.journeyapps.com/reference/container/calling-js-functions-from-xml#application

1 Like

Works beautifully. Thanks @KobieBotha