Skip to content

Instantly share code, notes, and snippets.

@mlcollard
Created April 30, 2018 14:08
Show Gist options
  • Save mlcollard/63ae18031fdc908705a6c76d59319d82 to your computer and use it in GitHub Desktop.
Save mlcollard/63ae18031fdc908705a6c76d59319d82 to your computer and use it in GitHub Desktop.
iOS: TVML: Navigating between pages
<document>
<alertTemplate>
<description>This page has been pushed onto the navigation stack.</description>
</alertTemplate>
</document>
<document>
<alertTemplate>
<title>Welcome to Page Navigation</title>
<description>This app shows how to navigate between TVML pages.</description>
<button onselect="getDocument('templates/NextPage.xml')">
<text>Next page</text>
</button>
</alertTemplate>
</document>
function loadingDoc() {
var template = `
<document>
<loadingTemplate>
<activityIndicator><text>Loading</text></activityIndicator>
</loadingTemplate>
</document>
`;
var templateParser = new DOMParser();
var parsedTemplate = templateParser.parseFromString(template, "application/xml");
navigationDocument.pushDocument(parsedTemplate);
}
App.onLaunch = function(options) {
loadingDoc()
var templateURL = "templates/PageNavigation.xml";
getDocument(templateURL);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment