Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is my solution for hiding the inner search icon.</p> <p>In your styles.xml where you manage your theme, add the following to your application_theme section (usually below the base_theme)</p> <pre><code>&lt;!--Application Theme--&gt; &lt;style name="application_theme" parent="application_base_theme"&gt; &lt;item name="searchViewSearchIcon"&gt;@android:color/transparent&lt;/item&gt; &lt;item name="searchViewCloseIcon"&gt;@android:color/transparent&lt;/item&gt; &lt;/style&gt; </code></pre> <p>This forces all occurrences of the search icon within the actionbar search widget to be transparent, and invisible.</p> <p>They will still take up space in the text field though, creating an invisible margin at the left side where the icon used to be. If you want to fix this, you must instead extend com.actionbarsherlock.widget.SearchView with your own class and add the following:</p> <pre><code>ImageView searchHintIcon = (ImageView) findViewById(R.id.abs__search_mag_icon); searchHintIcon.setVisibility(View.GONE); </code></pre> <p>I would add this to the Constructor but also override setIconified and setIconifiedByDefault and include it there as well. This will force it to hide the icon whenever you expand the action view.</p> <p>For showing other icons in the action bar, try setting:</p> <pre><code>android:showAsAction="collapseActionView|ifRoom" </code></pre> <p>This should cause the search bar to expand when there is enough room in the action bar, instead of forcing them off of the bar entirely.</p> <p>HTH</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload