iphone x php兼容吗,NVTabBar这个模块在iphone X上面出现兼容问题

这段代码展示了如何使用NVTabBar库初始化一个Tabbar,并设置了样式、图标和文字。Tabbar包含三个选项:首页、课程和我的。当用户点击'我的'时,会检查登录状态,未登录则弹出登录窗口,已登录则切换到相应页面。
摘要由CSDN通过智能技术生成

function initTabbar() {

NVTabBar.open({

styles: {

bg: '#fff',

h: 48,

dividingLine: {

width: 0.5,

color: '#ddd'

},

badge: {

bgColor: '#ff0',

numColor: '#fff',

size: 6.0,

fontSize: 10,

centerX: 6.0,

centerY: 6.0

}

},

items: [{

w: api.winWidth / 3.0,

bg: {

marginB: -4,

image: 'rgba(0,0,0,0)',

},

iconRect: {

w: 26.0,

h: 26.0,

},

icon: {

normal: 'widget://image/tabbar/home.png',

highlight: 'widget://image/tabbar/home_s.png',

selected: 'widget://image/tabbar/home_s.png'

},

title: {

text: '首页',

size: 10.0,

normal: '#4d3833',

selected: '#f38900',

marginB: 4.0

}

}, {

w: api.winWidth / 3.0,

bg: {

marginB: -4,

image: 'rgba(0,0,0,0)',

},

iconRect: {

w: 26.0,

h: 26.0,

},

icon: {

normal: 'widget://image/tabbar/course.png',

highlight: 'widget://image/tabbar/course_s.png',

selected: 'widget://image/tabbar/course_s.png'

},

title: {

text: '课程',

size: 10.0,

normal: '#4d3833',

selected: '#f38900',

marginB: 4.0

}

}, {

w: api.winWidth / 3.0,

bg: {

marginB: -4,

image: 'rgba(0,0,0,0)',

},

iconRect: {

w: 26.0,

h: 26.0,

},

icon: {

normal: 'widget://image/tabbar/mine.png',

highlight: 'widget://image/tabbar/mine_s.png',

selected: 'widget://image/tabbar/mine_s.png'

},

title: {

text: '我的',

size: 10.0,

normal: '#4d3833',

selected: '#f38900',

marginB: 4.0

}

}],

selectedIndex: 0

}, function(ret, err) {

if (ret) {

if (ret && ret.eventType == 'click') {

if(ret.index == 2){

var token = $func.getToken();

if(token){

tabbarIndex_ = ret.index;

fnOpenFrame(ret.index);

}else{

api.sendEvent({

name: 'openLoginWin'

});

loginCallback = function(){

fnOpenFrame(2);

}

}

}else{

tabbarIndex_ = ret.index;

fnOpenFrame(ret.index);

}

}

}

});

}

代码如上

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值