Ionic Custom Ion-tabs icon

Source: Internet
Author: User

There are many vector icons built into the ionic framework, which can be applied to ion-tabs multi-label switching.
Use the following:

<Ion-tabsclass= "Tabs-positive tabs-icon-only">  <Ion-tabtitle= "Home"icon-on= "Ion-ios7-filing"Icon-off= "Ion-ios7-filing-outline">    <!--Label 1 content -  </Ion-tab>  <Ion-tabtitle= "about"icon-on= "Ion-ios7-clock"Icon-off= "Ion-ios7-clock-outline">    <!--Label 2 content -  </Ion-tab>  <Ion-tabtitle= "Settings"icon-on= "Ion-ios7-gear"Icon-off= "Ion-ios7-gear-outline">    <!--Label 3 content -  </Ion-tab></Ion-tabs>

Corresponding effect:

It's not beautiful! Is there any way to personalize the tabs tag icon? For example: Complex method can search "Ionic custom Icon". The easy way is to borrow the Ion-tab template directly, "icon-on" and "Icon-off" with a custom class instead of the ion-* icon series:
<Ion-tabsclass= "Tabs-icon-top Tool-bar"Ng-class= "{' Tabs-item-hide ': hidetabs}">    <Ion-tabtitle= "Promotion"icon= "Bar-home-on"icon-on= "Bar-home-on"Icon-off= "Bar-home-off"href= "#/home"> <Ion-nav-viewname= "Home-tab"></Ion-nav-view> </Ion-tab>     <Ion-tabtitle= "Revenue"icon-on= "Bar-money-on"Icon-off= "Bar-money-off"href= "#/money"> <Ion-nav-viewname= "Money-tab" /> </Ion-tab>     <Ion-tabtitle=""icon-on= "Bar-service-on"Icon-off= "Bar-service-off"href= "#/service"> <Ion-nav-viewname= "Message-tab" /> </Ion-tab>     <Ion-tabtitle= "message"icon-on= "Bar-msg-on"Icon-off= "Bar-msg-off"href= "#/message"> <Ion-nav-viewname= "Message-tab" /> </Ion-tab>     <Ion-tabtitle= "my"icon-on= "Bar-mine-on"Icon-off= "Bar-mine-off"href= "#/user"> <Ion-nav-viewname= "User-tab" /> </Ion-tab> </Ion-tabs>

Css:

. Tab-item   {    margin-top: 1px;}  {    background: url (images/bar-home.png) no-repeat Center top}{     Background: url (images/bar-home-off.png) no-repeat Center top}

Ionic Custom Ion-tabs icon

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.