0
我使用創建的Android移動應用程序中使用的離子2.如何設置特定頁面的狀態欄的顏色只能用離子2
我正在使用status bar plugin。但我想改變狀態欄背景顏色每個頁面的狀態欄顏色。
當我在app.component.ts中使用下面的代碼。但它反映到所有頁面。如何實現它?
import { StatusBar } from '@ionic-native/status-bar';
constructor(private statusBar:StatusBar){
this.platform.ready().then(() => {
this.statusBar.backgroundColorByHexString('#ff6d79');
this.splashScreen.hide();
});
}
但它增加了代碼。另一種方式來實現它在一個共同的組件? – Sakthivel
是的,您可以訂閱根NavController事件並將其設置在那裏。 – JoeriShoeby