apicloud之iphoneX修復狀態欄

 

   //修復導航欄     
 var headerList=$api.domAll('header');
      for(var i=0;i<headerList.length;i++){
        $api.fixStatusBar(headerList[i]);
      }
//修復footer,這個方法,api.js中沒有需要另外添加
      $api.fixTabBar($api.byId('footer'));

添加代碼(添加進api.js中)

u.fixTabBar = function(el){ if(!u.isElement(el)){ console.warn('$api.fixTabBar Function need el param, el param must be DOM Element'); return 0; } el.style.paddingBottom = api.safeArea.bottom + 'px'; return el.offsetHeight;}
  

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章