How can I give my EditTexts a lighter background?

I'm able to change the back color of the screen/form itself, and the color of text, but what about the "insides" of EditText widgets? They are too dark for my liking:

enter image description here

I would like them to be white, or at least light gray.

UPDATE

By popular demand, here is the XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/black"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="4dip"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:lines="1"
            android:padding="5dip"
            android:textColor="#FFFF00"
            android:text="@string/textview_Inv_"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <EditText
            android:id="@+id/edttxtInvoiceNum"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            android:background="@drawable/greyframe" />

        <TextView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#FFFF00"
            android:lines="1"
            android:padding="5dip"
            android:text="@string/textview_Vendor"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <EditText
            android:id="@+id/edttxtVendor"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/greyframe" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1.25"
            android:lines="1"
            android:textColor="#FFFF00"
            android:padding="5dip"
            android:text="@string/textview_Total_"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <EditText
            android:id="@+id/edttxtTotalDollars"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/greyframe" />

        <TextView
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1.5"
            android:lines="1"
            android:textColor="#FFFF00"
            android:padding="5dip"
            android:text="@string/textview_Cur_Tot"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <EditText
            android:id="@+id/edttxtCurrentTotal"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/greyframe" />

        <TextView
            android:layout_width="0dip"
            android:textColor="#FFFF00"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:lines="1"
            android:padding="5dip"
            android:text="@string/textview_Qty"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <EditText
            android:id="@+id/edttxtQty"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/greyframe" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:id="@+id/btnPrint"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="@color/white"
            android:text="@string/button_Print" />

        <Button
            android:id="@+id/btnSave"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:textColor="@color/white"
            android:layout_weight="1"
            android:text="@string/button_Save" />

        <Button
            android:id="@+id/btnFind"
            android:layout_width="0dip"
            android:textColor="@color/white"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/button_Find" />

        <Button
            android:id="@+id/btnClear"
            android:layout_width="0dip"
            android:textColor="@color/white"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/button_Clear" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <EditText
            android:id="@+id/edttxtRed"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_margin="4dip"
            android:layout_weight="1"
            android:background="@drawable/redframe" />

        <EditText
            android:id="@+id/edttxtOrange"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_margin="4dip"
            android:layout_weight="1"
            android:background="@drawable/orangeframe" />

        <EditText
            android:id="@+id/edttxtYellow"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_margin="4dip"
            android:layout_weight="1"
            android:background="@drawable/yellowframe" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <EditText
            android:id="@+id/edttxtGreen"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_margin="4dip"
            android:layout_weight="1"
            android:background="@drawable/greenframe" />

        <EditText
            android:id="@+id/edttxtBlue"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_margin="4dip"
            android:layout_weight="1"
            android:background="@drawable/blueframe" />

        <EditText
            android:id="@+id/edttxtIndigo"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_margin="4dip"
            android:layout_weight="1"
            android:background="@drawable/indigoframe" />

        <EditText
            android:id="@+id/edttxtViolet"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_margin="4dip"
            android:layout_weight="1"
            android:background="@drawable/violetframe" />
    </LinearLayout>

UPDATE 2

I used Eldar's XML, and it now meets my semi-tough standards:

enter image description here

Upvotes: 1

Views: 221

Answers (1)

dreambit.io dreambitio
dreambit.io dreambitio

Reputation: 1902

I think you need use shapes. Create xml file in drawble:

<shape 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle">

    <corners android:radius="5dp" />
    <solid android:color="@android:color/white" />
    <stroke
        android:width="1dip"
        android:color="@color/bggrey" />
</shape>

And after set it as background of any view

<EditText
        android:layout_width="0dp"
        android:layout_weight=".50"
        android:layout_height="wrap_content"
        android:background="@drawable/your_file_name"
        android:id="@+id/editText3"/>

Upvotes: 2

Related Questions