解决android中icon只能使用一张icon的问题
来源:互联网 发布:mac口红国内专柜价格表 编辑:程序博客网 时间:2024/05/29 09:58
.html 中 绑定 ionselect的方法,tabicon使用变量
<ion-tabs>
<ion-tab [root]="tab1Root" (ionSelect)="change(0)" [tabTitle]="tab1Title"tabIcon="{{wenzhen}}"></ion-tab>
<ion-tab [root]="tab2Root" (ionSelect)="change(1)" [tabTitle]="tab2Title"tabIcon="{{huanzhe}}"></ion-tab>
<ion-tab [root]="tab3Root" (ionSelect)="change(2)" [tabTitle]="tab3Title"tabIcon="{{wode}}"></ion-tab>
</ion-tabs>
.ts 中
import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { IonicPage, NavController, Platform }from 'ionic-angular';
import { Tab1Root } from '../pages';
import { Tab2Root } from '../pages';
import { Tab3Root } from '../pages';
@IonicPage()
@Component({
selector: 'page-tabs',
templateUrl: 'tabs.html'
})
export classTabsPage {
tab1Root: any= Tab1Root;
tab2Root: any= Tab2Root;
tab3Root: any= Tab3Root;
tab1Title = " ";
tab2Title = " ";
tab3Title = " ";
wenzhen = "wenzhen";
huanzhe = "huanzhe";
wode = "wode";
constructor(publicnavCtrl:NavController, public translateService:TranslateService, public platform:Platform) {
translateService.get(['TAB1_TITLE','TAB2_TITLE', 'TAB3_TITLE']).subscribe(values=> {
this.tab1Title = values['TAB1_TITLE'];
this.tab2Title = values['TAB2_TITLE'];
this.tab3Title = values['TAB3_TITLE'];
});
}
change(a:number) {
if (this.platform.is("android")) {
if(a==0){
this.wenzhen = "wenzhenandroid";
this.huanzhe = "huanzhe";
this.wode ="wode";
}else if(a==1){
this.wenzhen = "wenzhen";
this.huanzhe = "huanzheandroid";
this.wode ="wode";
}else if(a==2){
this.wenzhen = "wenzhen";
this.huanzhe = "huanzhe";
this.wode ="wodeandroid";
}
}
}
}
自定义css icon
.ion-ios-wenzhen:before {
@include font-size-custom;
background: no-repeat url('../assets/imgs/wenzhenbefore.png');
}
.ion-ios-wenzhen-outline {
@include font-size-custom;
background: no-repeat url('../assets/imgs/wenzhen.png');
}
.ion-md-wenzhen {
@include font-size-custom;
background: no-repeat url('../assets/imgs/wenzhen.png');
}
.ion-md-wenzhenandroid:before {
@include font-size-custom;
background: no-repeat url('../assets/imgs/wenzhenbefore.png');
}
阅读全文
0 0
- 解决android中icon只能使用一张icon的问题
- Android开发中icon不一致的问题
- 解决Android 4.0以上版本中OptionsMenu菜单不显示ICON图标的问题
- Android开发中使用Icon Font
- 【Android 4.0】Android Icon Set的使用
- (转)java中Icon的问题
- APP工程中icon遇到的问题
- android开发(35) fragment和actionbar组合使用。解决不触发onOptionsItemSelected的问题,获得actionbar 的默认 get icon
- fusion-icon的问题
- Android中处理Touch Icon的方案
- Android中icon和logo的区别
- Android中icon与logo的区别
- EasyUI中使用自定义的icon图标
- Android的icon尺寸
- Icon的使用
- ICON资源的使用
- Android 解决android4.0系统中菜单(Menu)添加Icon无效问题
- 解决android4.4 中添加Menu的icon时,没有显示的问题
- 使用wok kimchi插件管理kvm(编译安装)
- 二代测序call indel 总结
- Log4j记录日志
- charles入门教程
- .NET、JAVA和PHP在Web开发的优缺点
- 解决android中icon只能使用一张icon的问题
- 写文件时候,permission deny的原因:建文件,ls,用户和用户组
- java正则工具类2
- 使用Intellij IDEA创建SpringBoot项目
- MaterialShowcaseView实现引导页
- 浅谈装饰(包装)模式
- Mac安装MySQL后,设置初始密码
- 启动Tomcat一闪而过,报JRE_HOME环境配置错误
- 开始写博客