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

Android 4.2.1 把狀態列時間移到左側教學(以 CM10.1 為例)

編輯:Android 刷機技巧

預設的時間顯示在狀態列右側,想改成左側配置,只要動一個字串就好。以下以 CM10.1 為例。

步驟一:反編譯 SystemUI

反編譯 4.2.1 的 systemui.apk,找到 systemui\res\layout\ 目錄下的 status_bar.xml 並開啟編輯。

步驟二:刪除原本的時鐘節點

找到下面這段宣告並整段刪除,注意不要留下多餘空白:

<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:clickable="false" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

步驟三:換個位置貼回去

接著找到這段容器宣告:

<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">

在它下方貼上同樣的 Clock 節點:

<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:clickable="false" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

完成

回編譯、簽名並刷入即可看到時間移到左側。若開不了機,通常是 XML 結構被破壞,還原備份重來一次即可。

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