6秒真男人
6秒真男人
  • 发布:2017-02-21 15:56
  • 更新:2017-02-21 16:06
  • 阅读:1204

想问下有没有8.x的mui的nativeObj的导航菜单的示例啊

分类:MUI

想问下有没有8.x的mui的nativeObj的导航菜单的示例啊

2017-02-21 15:56 负责人:无 分享
已邀请:
DCloud_UNI_CHB

DCloud_UNI_CHB

新建Hello MUI,首页列表中:
nav bar(导航栏) --> native title

对应生成的代码如下:

var view = new plus.nativeObj.View("title", {  
    top: 0,  
    height: "44px",  
    width: "100%",  
    dock: "top",  
    position: "dock"  
});  

view.drawRect("#f7f7f7"); //绘制背景色  
view.drawRect("#cccccc", {  
    top: "43px",  
    left: "0px"  
}); //绘制底部边线  

var bitmap = new plus.nativeObj.Bitmap("back");  
bitmap.loadBase64Data("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAb1BMVEUAAAAAev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8Aev8AAACubimgAAAAI3RSTlMAGfUTGfQTGPMSGPIYGhgaGBsXGxcbFxwXHBccFhwWHRYdHWufDPQAAAABYktHRACIBR1IAAAAB3RJTUUH4QETEBwooeTlkQAAAJVJREFUSMft1EkSgkAQRNFGUXFWHBDBibr/HTUwD5B/48Ig1y+io7u6MqUhf5hsNEY+j5hMgZ/FJ8Xc9ovos3T96utjbfqN/Nb0O/m96Uv5g+mP8ifTn+Ur01/ka9Nf5RvTt/I309/lH6Z/yr9Mn+Q71/MT8B34K/E58Enzv8R/K98HvnF8p3lr8F7izce7lbf3kJ/lDQp9HdBhgg3PAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTAxLTE5VDE2OjI4OjQwKzA4OjAwpTDFwQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0wMS0xOVQxNjoyODo0MCswODowMNRtfX0AAAAASUVORK5CYII=");  
view.drawBitmap(bitmap, {}, {  
    top: "10px",  
    left: "10px",  
    width: "24px",  
    height: "24px"  
});  
view.drawText(this.innerText.trim(), {}, {  
    size: "17px",  
    weight: "normal"  
});  

view.setTouchEventRect({  
    top: "0px",  
    left: "0px",  
    width: "44px",  
    height: "100%"  
});  
view.interceptTouchEvent(true);  
view.addEventListener("click", function(e) {  
    webview.evalJS("mui.back();");  
}, false);  
webview.append(view);
  • 6秒真男人 (作者)

    谢谢,我说的是那种底部导航的那种,首页切换子页面的

    2017-02-21 16:16

要回复问题请先登录注册