【发布时间】:2017-12-27 21:45:23
【问题描述】:
我试图在子页面中隐藏导航栏和选项卡(位于底部)我找到了使用访问 css 样式并将 display 更改为 none 的解决方案。
我成功隐藏了导航栏和选项卡,但问题是子页面 tableView 中仍然存在空白,并且子页面内容在两个空白之间,如您在屏幕截图中看到的那样
我该如何解决这个问题?
这是我隐藏导航栏和标签的代码
//get all tabs elements
if (document.querySelector('.tabbar')) {
this.tabBarElements = document.querySelectorAll('.tabbar.show-tabbar');
}
//get all toolbar elements
if (document.querySelector('.toolbar')) {
this.toolBarElements = document.querySelectorAll('.toolbar');
}
}
//hide all tabs and the header toolbar when enter page
ionViewWillEnter() {
if (this.tabBarElements) {
this.tabBarElements[0].style.display = 'none';
this.tabBarElements[1].style.display = 'none';
}
if (this.toolBarElements) {
this.toolBarElements[1].style.display = 'none';
}
}
信息
我找到了导致问题的原因(参见底部的屏幕截图),但我无法通过访问 CSS 对其进行更改
【问题讨论】:
-
我在这个问题中使用了 LeRoy 的代码
-
我找到了导致问题的原因,但我无法使用 css 对其进行更改