html - Ionic - 巨大的标志没有完全显示

标签 html ionic-framework

我对 ionic 很陌生。试图将漂亮的图片放入标题中。所以在我在 index.html 中添加 ion-nav-title 之后它就变成了这样 http://imgur.com/a/XzCpS , 图片太大了。我需要完全显示图像,并且顶部导航栏不会阻止页面的形式。非常感谢所有帮助:)

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <link rel="manifest" href="manifest.json">

    <!-- un-comment this code to enable service worker
    <script>
      if ('serviceWorker' in navigator) {
        navigator.serviceWorker.register('service-worker.js')
          .then(() => console.log('service worker installed'))
          .catch(err => console.log('Error', err));
      }
    </script>-->

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- your app's js -->
    <script src="lib/ngStorage.min.js"></script>
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/services.js"></script>
  </head>
  <body ng-app="starter">
    <!--
      The nav bar that will be updated as we navigate between views.
    -->
    <ion-nav-bar class="bar bar-header navBar" align-title="center">  

   <ion-nav-back-button>
   </ion-nav-back-button>

   <ion-nav-title>
        <img alt="Company Logo" height="100" src="img/logo.png">
   </ion-nav-title>


   </ion-nav-bar>
    <!--
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    -->
   <ion-nav-view></ion-nav-view>
  </body>
</html>

style.css*

.navBar {
    height: 100px;
    background: #fffef1;
}

Eventsearch.html

<ion-view>
  <ion-content padding="true" class="has-header">
    <form id="othername-form1" class="list">
        <label class="item item-input">
        <span class="input-label">Name</span>
        <input type="text">
      </label>
        <label class="item item-input">
        <span class="input-label">Date</span>
        <input type="date">
      </label>
      <label class="item item-select" >
        <span class="input-label">Country</span>
        <select ng-model="selected">
          <option>Hong Kong</option>
          <option>Tokyo</option>
          <option>Paris</option>
        </select>
      </label>
    </form>
    <a  class="button button-positive  button-block" ui-sref="tab.schedule({country:selected})">Go</a>
    <p>You are searching for events in {{selected}}</p>
  </ion-content>
</ion-view>

最佳答案

尝试将高度设置为 auto 并将最大值设置为一个巨大的值:

.navBar {
    height: 100;
    background: #fffef1;
}

ion-nav-title {
    height: 100;
}

关于html - Ionic - 巨大的标志没有完全显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44441542/

相关文章:

ionic-framework - 无论如何在闪屏后删除白屏

angularjs - ngCordova Bower 错误 - 有什么解决办法吗?

angularjs - AngularJS 中的循环选择器

html - 如何在 Underscore_S 中居中对齐我的标题图片

html - 将 PNG 图像放置在 div 轮播中

javascript - ionic 无限滚动以显示更多已加载的项目(不是通过 httprequest)

javascript - 加速 Ionic 应用程序中的 Levenshtein 距离计算

html - 在盒子中间的CSS中制作箭头

javascript - 图像上的摆动动画。 (就像酒馆的招牌。)

javascript - 如何在没有事件或按钮的情况下使图像出现和消失