簡體   English   中英

當我減少它時,如何從我的離子應用程序頂部更改背景顏色?

[英]How do I change the background color from the top of my ionic application when I reduce it?

大家,早安,

我有一個小問題。 當我減少它時,我希望能夠從我的離子應用程序頂部更改顏色......

藍色背景色

我也不知道這個區域叫什么......就像這個截圖一樣。 facebook 應用程序的背景為藍色...

謝謝您的幫助...

此查詢的可能解決方案可能很棘手,因為它還取決於您在手機上使用的啟動器的樣式您可以嘗試以下解決方案:-

解決方案 1: - 在 app.component.ts 中設置應用加載時的狀態欄顏色

initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.statusBar.backgroundColorByHexString('#ffffff');// change the status bar color of the app so when minimize it it keeps the color u mentioned
            //rest of ur calls
});
  }

解決方案 2:- 通常最小化 window 采用已減少應用程序的頁面的 header 的顏色

<ion-header>
    <ion-toolbar color="primary"> <!--u can use any color or change ur color in variable.css-->
        <ion-title>Login</ion-title>
    </ion-toolbar>
</ion-header>

讓我知道這是否有幫助

謝謝您的回答。 不幸的是,這並不總是有效。

在此處輸入圖像描述

這是圖片。 我希望將藍色背景更改為另一種顏色。 但我做不到。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM