ionic 2 back button or any icon is not showing. only small box icon is showing
Asked Answered
Y

1

2

I am facing this icon problem in many screen. for example. i have one screen , where i have added some icon at left side of nav bar. but its not at all showing the icon. only small back box alone is showing .here is my code:

 <ion-buttons>
    <button ion-button >
        <ion-icon name="close"></ion-icon>
      </button>
       </ion-buttons

I use this also :

 <ion-buttons>
        <button ion-button >
<ion-icon ios="ios-close" md="md-close"></ion-icon>
 </button>
           </ion-buttons

but no use.still black small box icon is showing.

okay now, i tried with push nav.but there alos its not showing the back button.here is my code :

my home.html :

  <button class="button button-outline footerbtnone" (click)="login()">LOG IN</button>

my home.js

 constructor(public navCtrl: NavController) {
  }
login() {
    this.navCtrl.push(LoginPage);

  }

But when i move to LoginPage i can't see the back button icon. still i am seeing that small black box icon.here that image :

enter image description here

please help me out.what i am missing.

Thanks

Yasui answered 1/5, 2017 at 8:12 Comment(15)
do you have ionicons in your package.json?Superordinate
@suraj under dependencies i have ` "ionicons": "3.0.0",` 'Yasui
@suraj i was not able to figure out what the problem wasYasui
Not sure if it is the same..i had this issue I only had to restart ionic serve..Superordinate
@suraj many time i done that ionic serveYasui
@suraj deleting the node_module folder from project. and instaiing npm install does it will help. or any removing platform and adding platform does it will help ?Yasui
try resetting node_modules..I dont see anything wrong with the code thoughSuperordinate
@suraj resetting means deleting it and adding it again right ?Yasui
yes.. delete and npm install.. have you set any content security policy?Superordinate
no . i din set any, if it there by miss. where i can check thatYasui
its generally set in index.html #30173154Superordinate
@suraj no not like that. i will reisntall node module and let you knowYasui
@suraj i tried. But same problemYasui
any errors in console?Superordinate
no, din get anyYasui
L
2

The squares probably signal that the font is either not getting loaded properly or the browser is trying to use an alternate font face. An easy way to verify that the ionicons font is being loaded at all is to check your sources in Chrome Dev Tools. Mine looks like this: http://localhost:8100/assets/fonts/ionicons.woff2?v=3.0.0-alpha.3

If you don't see that file (or something similar) getting loaded then there's no font to render.

The ionicon font should get loaded automagically if it's referenced in your package.json file and exists in the node_modules folder. After verifying this, if the font is not getting loaded, make sure you don't have any other CSS imports/variables that are overriding the ionicons font import. e.g something like this:

 * {font-family: 'Lato' !important;}

The above will result in the ionicons font never being loaded because Lato is specified to be used for all glyphs, overriding the earlier @ionicons import.

Lipps answered 16/5, 2017 at 5:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.