|
function initNav(navData) {
// 引用NVNavigationBar 模块
var NVNavigationBar = api.require('NVNavigationBar');
var nav = $api.byId('nav');
var navOffset = $api.offset(nav);
// console.log(JSON.stringify(navData));
NVNavigationBar.open({
rect: {
x: 0,
y: navOffset.t,
w: 'auto',
h: 45
},
styles: {
orientation: 'horizontal',
bg: '#red',
bgAlpha: 1,
font: {
size: 16,
sizeSelected: 16,
color: '#000',
colorSelected: '#FE27B7',
alpha: 1
},
itemSize: {
w: 60,
h: 48
}
},
items: [{
"title": "娱乐",
"bg": "#fff"
}, {
"title": "测试",
"bg": "#fff"
}],
selectedIndex: 0,
fixedOn: api.frameName,
fixed: false,
id: 'first'
}, function(ret, err) {
// alert(ret.index);
console.log(ret.eventType);
if (ret.index == 'undefined') {
} else {
api.setFrameGroupIndex({
name: 'mainListFrameGroup',
index: ret.index
});
}
});
}
我用的NVNavigationBar模块,为啥ios的手机显示,安卓的就不显示呢 |
|