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:
<view title="">
<view title="{my_view_variable}">
<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/app-features/xml-format-strings
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/app-features/calling-js-functions-from-xml
1 Like
Works beautifully. Thanks @KobieBotha