Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

華為 C8813 改狀態欄時間顏色,白字一秒搞定

編輯:Android 刷機技巧

想讓狀態欄的時間更清楚一點?改一個屬性就好。以下示範改成白色。

步驟一:反編譯 SystemUI.apk

用 apktool 把 /system/app 下的 SystemUI.apk 反編譯出來。

步驟二:找到時鐘的版面定義

開啟 SystemUI.apk\res\layout\tw_status_bar.xml,找到 Clock 這個節點,原貌如下:

<com.android.systemui.statusbar.policy.Clock
android:textSize="@dimen/status_bar_clock_text_size"
android:ellipsize="none" android:gravity="left|center" android:id="@id/clock"
android:paddingLeft="3.0dip" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:singleLine="true"
android:includeFontPadding="false" />

步驟三:加上 color 屬性

在 singleLine 之後插入一行:

android:textColor="#ffffffff"

#ffffffff 就是不透明的白色。想換別的顏色,把後六位換成對應的色碼即可(例如 #ff34b4e3 是 ICS 藍)。

改完的節點長這樣:

<com.android.systemui.statusbar.policy.Clock
android:textSize="@dimen/status_bar_clock_text_size"
android:ellipsize="none" android:gravity="left|center" android:id="@id/clock"
android:paddingLeft="3.0dip" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:singleLine="true"
android:textColor="#ffffffff"
android:includeFontPadding="false" />

步驟四:回編譯並覆蓋

回編譯整個專案,取出輸出的 tw_status_bar.xml 與 resources.arsc,覆蓋回原始 APK 的對應位置,再把 APK 推回 /system/app,修正權限後重開機。

一個實務提醒

改 SystemUI 之前務必先備份原檔。它是開機必載的服務,一旦回編譯失敗或 XML 格式有誤,後果是開機後不斷重啟、連桌面都進不去。此時只能靠 Recovery 或 adb 把原檔推回去搶救。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved