apply Orange style to my search view

I want to apply Orange style to my search view which is an item in the action bar menu , I generated the orange style using http://android-holo-colors.com/ and I assigned the style to my search view using

 <item
        android:id="@+id/menu_search"
        style="@style/EditTextOrange"
        android:actionViewClass="android.widget.SearchView"
        android:icon="@drawable/action_search"
        android:showAsAction="always"
        android:title="search"/>

my style

<?xml version="1.0" encoding="utf-8"?>

<!-- Generated with http://android-holo-colors.com -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">

  <style name="EditTextOrange" parent="android:Widget.EditText">
      <item name="android:background">@drawable/edit_text_holo_light</item>
      <item name="android:textColor">#000000</item>
  </style>

</resources>

How can I apply the style to my search view ?

Upvotes: 1

Views: 1799

Answers (2)

I solve the problem using textfield_activated_holo_light image which is generated from http://android-holo-colors.com/

searchPlate.setBackgroundResource(R.drawable.textfield_activated_holo_light);

Upvotes: 1

Ahmad
Ahmad

Reputation: 72673

You can change the SearchView drawable like this:

<style name="EditTextOrange" parent="android:Theme.Holo">

    <item name="android:searchViewTextField">@drawable/mySearchView</item>

</style>

Upvotes: 1

Related Questions