NativeJS - Tab menu
To select tabs:
1
if (navigator.userAgent.indexOf('gonative') > -1) {
2
window.location.href = 'gonative://tabs/select/1';
3
}
Copied!
Note that the tabs are 0-indexed, i.e. tabs/select/1 will select the second tab
To change the tabs:
1
var tabs = {
2
"enabled": true,
3
"items": [{
4
"icon": "fa-cloud",
5
"label": "Tab 1",
6
"url": "javascript:alert('You selected tab 1')"
7
}, {
8
"icon": "fa-globe",
9
"label": "Tab 2",
10
"url": "javascript:alert('You selected tab 2')"
11
}, {
12
"icon": "fa-users",
13
"label": "Tab 3",
14
"url": "javascript:alert('You selected tab 3')"
15
}]
16
};
17
18
var json = JSON.stringify(tabs);
19
window.location.href='gonative://tabs/setTabs?tabs=' + encodeURIComponent(json);
Copied!
To hide the tabs, set "enabled" to false.
Last modified 1yr ago
Copy link