-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.js
56 lines (49 loc) · 1.42 KB
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//BOTTOM NAVIGATION
var BottomNavigation = require('/BottomNavigation');
var window = Ti.UI.createWindow({
backgroundColor : 'white'
});
var view1 = Titanium.UI.createView({backgroundColor : '#FFA000'});
var view2 = Titanium.UI.createView({backgroundColor : '#F57C00'});
var view3 = Titanium.UI.createView({backgroundColor : '#E64A19'});
var scrollableView = Titanium.UI.createScrollableView({
views : [view1, view2, view3],
scrollingEnabled : false,
zIndex : 1
});
window.add(scrollableView);
var buttonsSpecs = [
{
title : 'First',
activeIcon : '/images/ic_parceiros_ativo.png',
inactiveIcon : '/images/ic_parceiros_inativo.png',
backgroundRippeColor : '#009688',
},
{
title : 'Second',
activeIcon : '/images/ic_promocoes_ativo.png',
inactiveIcon : '/images/ic_promocoes_inativo.png',
backgroundRippeColor : '#3F51B5',
},
{
title : 'Third',
activeIcon : '/images/ic_meus_cartoes_ativo.png',
inactiveIcon : '/images/ic_meus_cartoes_inativo.png',
backgroundRippeColor : '#795548',
}
];
var bottomNavigation = BottomNavigation.create({
buttons : buttonsSpecs,
activeButtonIndex : 0,
activeFontColor : "#FFFFFF",
//inactiveFontColor : "#A8A8A8",
//rippleColor : "#4DB6AC",
backgroundColor : '#00796B',
backgroundRipple : true,
hideInactiveButtonTitle : true
});
window.add(bottomNavigation);
bottomNavigation.addEventListener('clicked', function(e){
scrollableView.scrollToView(e.index);
});
window.open();