Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Como alterar ícone padrão de um searchview ?

Você pode alterar o ícone no xml..

Eu uso ela assim.. espero que ajude..


Xml

    <item
        android:id="@+id/menu_pesquisar"       
        android:icon="@drawable/ic_stat_search_branco"
        android:title="@string/pesquisar"
        app:actionViewClass="android.support.v7.widget.SearchView"       
        app:showAsAction="ifRoom|collapseActionView" /> // To usando a ActionBarCompat

Class

Dentro do metodo onCreateOptionsMenu

        MenuItem searchItem = menu.findItem(R.id.menu_pesquisar);
               
        SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
        searchView.setQueryHint(this.getString(R.string.pesquisar));
        searchView.setOnQueryTextListener(this);   
 


2014/1/23 Lucas Santos <idlucas.sis@gmail.com>
Preciso alterar a cor do ícone padrão de um searchview, alguém já conseguiu altera-lo ?

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Rudson Lima ( live-O )
Desenvolvedor Android - Web Service C# - SQL Server - Delphi
+55 85 87050560 - Fortaleza-ce

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário