【问题标题】:Ionic Header (v1) Custom HTML in headerIonic Header (v1) 标题中的自定义 HTML
【发布时间】:2017-03-02 01:58:07
【问题描述】:

我想在 ion-nav-bar 元素中添加一些自定义 html(3 个小天气图标)来代替右侧的按钮。当我尝试添加 html 时,它不会出现在视图中,尽管我可以在检查器中看到 html。我无法确定是什么隐藏了它。如果我在它们的位置粘贴一个按钮元素,则显示效果很好。如果我不将自定义 html 放在 ion-nav-button 指令中,则 html 本身会在视图中消失

<ion-view>
    <ion-nav-bar class="tsw-dark">
        <ion-nav-buttons side='left'>
            <!-- this button shows fine -->
            <button menu-toggle="left" class="button button-clear button-icon icon ion-navicon home-icon"></button>
        </ion-nav-buttons>
        <ion-nav-buttons side='right'>
            <!-- the html inside this block does not render in the view though I can find it with the inspector -->
            <div class='t-h-wi'><i class='icon ion-ios-sunny-outline'></i></div>
            <div class='t-h-wi'><i class='icon ion-ios-sunny-outline'></i></div>
            <div class='t-h-wi'><i class='icon ion-ios-sunny-outline'></i></div>
        </ion-nav-buttons>
    </ion-nav-bar>   
<ion-content>
.....

【问题讨论】:

  • 这是您可以在导航栏中看到这些图标的笔。 codepen.io/anon/pen/evJvYz?editors=1010#0我没有看到您的代码有任何问题。 (一旦通过检查器或更改位置检查元素的位置。)
  • 谢谢!笨蛋不一样。在我的代码中,包含标题的视图是一个独立于 index.html 的文件。不确定这是否会有所作为。它也存在于 指令中。同样,不确定这是否重要。我已经更新了问题中的代码。
  • 啊!他们在那里。它们与背景颜色相同。啊!!

标签: javascript ionic-framework hybrid-mobile-app


【解决方案1】:

我觉得很傻,但有时答案很简单,就像这次一样简单,就像“有问题的元素与背景颜色相同”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-21
    • 2017-08-28
    • 1970-01-01
    • 2020-06-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多