Zepse Wolf
Zepse Wolf

Reputation: 41

Ionic - Huge logo doesn't show fully

I am very new to ionic. Trying to put a nice looking picture into the header. So right after I added the ion-nav-title in index.html it becomes like this https://i.sstatic.net/dNYj5.jpg , the picture was too big. I need the image to fully be shown and also the top nav to not block the form the page.All help will be greatly appreciated :)

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>

Upvotes: 2

Views: 55

Answers (1)

maninak
maninak

Reputation: 2726

Try setting the height to auto and the maximum to a huge value:

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

ion-nav-title {
    height: 100;
}

Upvotes: 0

Related Questions