【问题标题】:Ionic 2 - How to remove gap between header and content?Ionic 2 - 如何消除标题和内容之间的差距?
【发布时间】:2017-06-09 21:20:48
【问题描述】:

我有一个 Ionic 2 侧边菜单 应用程序。当我切换菜单时,它会弹出,再次切换时它会消失,但在标题和内容之间(在左侧)之间会产生间隙

有人知道为什么会这样吗?

同样在页面上进行一些交互(单击按钮)后,间隙消失了。

【问题讨论】:

  • 我会假设 no-padding 属性,在 Ionic 的许多元素中都可以找到(例如 <ion-content no-padding> ),但是没有您的代码 - 重现您的问题有点问题。我建议你使用stackblitz.com

标签: ionic2


【解决方案1】:

你是如何使用菜单的?你能包括你的代码吗? 如何关闭菜单功能以无间隙隐藏菜单 例如:

constructor(public platform: Platform, public menu: MenuController)

openPage(page) { // close the menu when clicking a link from the menu this.menu.close(); this.nav.push(page.component); }

【讨论】: