Here's my original question on ionic forum. There has been no responses to it for some time so I thought I could hopefully get some help from here :(
So, my question is really the title. I would like to use my custom image as the icon for ion-tab in my ionic application. I've checked that it works via ionic serve
by doing it as the following:
tabs.html
<ion-tabs class="tabs-icon-bottom tabs-color-active">
<!-- this icon does not load -->
<ion-tab title="LIVE" icon="tab-live energized" href="tab/live">
<ion-nav-view name="tab-live"></ion-nav-view>
</ion-tab>
<ion-tab title="REPLAY" icon="tab-replay energized" href="tab/replay">
<ion-nav-view name="tab-replay"></ion-nav-view>
</ion-tab>
<ion-tab title="SETTINGS" icon="ion-android-options energized" href="tab/setting">
<ion-nav-view name="tab-setting"></ion-nav-view>
</ion-tab>
</ion-tabs>
style.css
...
.tab-live {
background-repeat: no-repeat;
background-size: contain;
background-position-x: center;
background-image: url('../img/live.png');
}
.tab-replay {
background-repeat: no-repeat;
background-size: contain;
background-position-x: center;
background-image: url('../img/replay.png');
}
however, when I run the app on my android device, it says Failed to load resource: net::ERR_FILE_NOT_FOUND
for my tab-live
and the tab-live
icon won't load. From what I understand, this error occurs when the app tries to load a certain asset file before it gets loaded in to the memory. But only the tab-live
image fails to load while all other images loads fine.
If it could be of an issue, the tab/live
page is what loads when the app starts, and the size of my live.png
file is about 5.54kb
. I have another image that I use in this tab/live
page that is larger this image, but it loads fine and I use an img
tag with ng-src={{ btnImage }}
to change it around.
So, what could be causing this problem and how could I resolve it?
Thanks in advance.