1、先安装ThemeableBrowser插件
分别执行以下命令
ionic cordova plugin add cordova-plugin-themeablebrowser
npm install --save @ionic-native/themeable-browser
2、使用ThemeableBrowser插件
如下demo:
import{Component}from'@angular/core';
import{IonicPage,NavController,NavParams}from'ionic-angular';
import{ThemeableBrowser}from"ionic-native";
@IonicPage()
@Component({
selector:'page-woqu',
templateUrl:'woqu.html',
})
exportclassWoquPage{
constructor(publicnavCtrl:NavController,publicnavParams:NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad WoquPage');
}
liulanqi(){
letoptions= {
statusbar:{
color:'#f8285c'
},
toolbar:{
height:44,
color:'#f8285c'
},
title:{
color:'#ffffffff',
showPageTitle:true
},
backButton:{
image:'back',
imagePressed:'back_pressed',
align:'left',
event:'backPressed'
},
backButtonCanClose:true
};
newThemeableBrowser('http://write.blog.csdn.net/postedit','_blank',options);
}
}