我找到了一個教程,演示如何通過將android:background="@drawable/btn_green"
添加到xml
文件中來更改Button
的style
。如何使用android更改按鈕樣式:background =「@ drawable/btn_green」
我曾嘗試加入:
<Button
android:id="@+id/my_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"
android:background="@drawable/btn_green"/>
我得到一個錯誤的xml
文件說error: Error: No resource found that matches the given name (at 'background' with value '@drawable/btn_green').
教程說,我需要import the Backgrounds project into Eclipse by choosing the Import option from the File menu
。
我試過去File > Import
但我找不到與背景有關的任何東西。
任何人都可以提出我需要做什麼?
我想我在這裏感到困惑。我認爲有一種標準的背景風格庫可以添加到您的項目中。我認爲你必須製造你自己的? –