2014-06-23 130 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

相关问题