2014-06-23 126 views
1

我只是想將Holo EditText的背景改爲綠色。我如何製作看起來像這樣的定製Holo EditText

事情是這樣的:http://tinypic.com/view.php?pic=2n20k8l&s=8#.U6hMQ_ldWSo

這可能是一個愚蠢的問題,但我搜索,沒有結果!謝謝!

+1

哪一個可以顯示一些圖像或鏈接? –

+0

在佈局的XML中試試'android:background =「#0f0」' – SMR

+0

這個問題似乎是無關緊要的,因爲它缺少足夠的信息來識別問題。 – Raghunandan

回答

2

下面是代碼來實現你想要什麼。

<RelativeLayout 
    android:id="@+id/one" 
    android:layout_width="250dp" 
    android:layout_height="55dp" 
    android:background="#006400" > 

    <EditText 
     android:id="@+id/editText1" 
     android:layout_width="220dp" 
     android:layout_height="45dp" 
     android:layout_centerInParent="true" 
     android:ems="10" > 

     <requestFocus /> 
    </EditText> 
</RelativeLayout> 
+0

謝謝隊友! (Y) – Borzstag

1

在你的XML,屬性添加到您的EditText:

android:background="@android:color/holo_green_dark" 

OR

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@android:color/holo_green_dark"> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:hint="edit" 
     /> 

</LinearLayout> 
+0

這種顏色最小的API是14 ..我的應用程序min API是8 – Borzstag

+0

簡單改變LinearLayout背景 – NoXSaeeD

相關問題