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

讓狀態欄時間精確到秒:靠左或維持靠右兩種改法

編輯:更多教學

教你如何把三星N7100狀態欄的時間精確到秒顯示,分成「靠左」與「原始靠右」兩種做法。

一、時間精確到秒(靠左)

1. 先反編譯 SystemUI.apk。

2. 找到檔案 SystemUI.apk\res\layout\tw_status_bar.xml(建議用 Notepad++ 開啟編輯)。

3. 刪除以下程式碼:

android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" 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" />

4. 找到以下程式碼:

android:paddingLeft="4.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">

5. 在該段程式碼後面換行加入:

android:layout_width="wrap_content" android:layout_height="fill_parent"> android:textColor="#ff959595" android:gravity="center" android:id="@+id/digitalClock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />

6. 編輯儲存後編譯 SystemUI。

7. 編譯後把 res\layout\tw_status_bar.xml 與 resources.arsc 複製回原 SystemUI.apk 替換,再複製到手機、修改權限並重啟即可。

二、時間精確到秒(維持靠右)

1. 反編譯 SystemUI.apk。

2. 找到 SystemUI.apk\res\layout\tw_status_bar.xml。

3. 找到以下程式碼:

android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" 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" />

改為:

android:textColor="#ff959595" android:gravity="center" android:id="@+id/digitalClock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />

4. 找到以下程式碼:

android:paddingLeft="4.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">

在其後換行加入:

android:layout_width="wrap_content" android:layout_height="fill_parent">

5. 編輯儲存後編譯 SystemUI。

6. 編譯後把 res\layout\tw_status_bar.xml 與 resources.arsc 複製回原 SystemUI.apk 替換,再複製到手機、修改權限並重啟即可。

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