2011-05-02 89 views
3

Android佈局xml文件具有「android:」前綴與每個屬性。刪除android:前綴爲每個屬性

有沒有解決它們的解決方案。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/linearLayout1" 
    android:layout_height="fill_parent" 
    android:layout_width="wrap_content"> 
    <Button android:id="@+id/button1" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:text="@string/test_button"> 
    </Button> 
</LinearLayout> 
+1

但你爲什麼要刪除它? – Mudassir 2011-05-02 07:37:18

+1

增加手動修改時間。在我看來,這不是一種友善的方式。 – 2011-05-02 08:49:05

+0

請參閱最新的答案。 – Mudassir 2011-05-03 03:23:26

回答

5

可能是本貼幫助你; http://groups.google.com/group/android-developers/browse_thread/thread/d94c1f53a331c53b

請看這篇文章知道,爲什麼有一個android前綴; Android XML layout files and namespace

更新:(後Josh的評論)

另一種方式做同樣是使用Eclipse的找到一個正則表達式/替換工具。這種方法比第一種方法更容易。

+0

哇,你鏈接到的腳本比在Eclipse中執行正則表達式查找/替換更復雜:( – Josh 2011-05-02 17:07:58

+0

@Josh:我的回答沒有錯,因爲你低估了它,但我仍然更新它。謝謝。 – Mudassir 2011-05-03 05:51:30

+0

感謝編輯,我會解除投票:) – Josh 2011-05-03 14:38:43