Tecnologia do Blogger.
RSS

[androidbrasil-dev] Re: ActionBarSherlock - Colorir texto do submenu


Paulo,

Você tem que criar seu proprio item para poder mudar a cor e adcionar no Adapter ...

Exemplo:

custom_spinner_item.xml

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" 
    style="?android:attr/dropDownItemStyle"
    android:singleLine="true"
    android:layout_width="match_parent"
    android:layout_height="50sp"
    android:textColor="#CDDA1C"
    android:ellipsize="marquee"/>

Na criação do Adapter:

SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this,
R.array.lists,
R.layout.custom_spinner_item);

Enjoy!
-- 
/*
* Atenciosamente/ Regards/ Saludos, 
* Jan Souza
*/
On Thursday, May 24, 2012 7:26:21 AM UTC-3, Paulo BlasterX wrote:
Como colorir o texto de submenu da Action Bar Sherlock ? Eu já tentei aqui mas só consigo colorir o fundo. O texto não.. Alguém pode me ajudar ?
Já pesquisei muito muito mesmo e não consegui.. =(

Tenho lá no meu temas.xml

    <style name="Tema.Laranja" parent="Theme.Sherlock.Light.ForceOverflow">
        <item name="android:buttonStyle">@style/BotaoLaranja</item>
        <item name="android:windowBackground">@drawable/background_repeat</item>
          
           <item name="actionBarStyle">@style/Tema.Laranja.ActionBar</item>
        <item name="android:actionBarStyle">@style/Tema.Laranja.ActionBar</item>
       
        <item name="actionBarItemBackground">@drawable/background_selecionado</item>
        <item name="android:actionBarItemBackground">@drawable/background_selecionado</item>
       
        <item name="android:dropDownListViewStyle">@style/Tema.Laranja.ListSelector</item>
        <item name="dropDownListViewStyle">@style/Tema.Laranja.ListSelector</item>
       
        <item name="popupMenuStyle">@style/Tema.Laranja.Popup</item>
        <item name="android:popupMenuStyle">@style/Tema.Laranja.Popup</item>
    </style>
   
        <style name="Tema.Laranja.Popup" parent="Widget.Sherlock.Light.PopupMenu">
        <item name="android:popupBackground">@drawable/shape_laranja_arredondado</item>
    </style>
   
    <style name="Tema.Laranja.ListSelector" parent="Widget.Sherlock.ListView.DropDown">
        <item name="android:listSelector">@color/listview_actionbar</item>
        <item name="android:textColor">@color/branca</item>
        <item name="android:drawSelectorOnTop">true</item>
    </style>
   
   
No meu listview_actionbar.xml

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

    <item android:state_focused="false"
        android:drawable="@drawable/shape_amarelo_arredondado"/>

    <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
    <item android:state_focused="true" android:state_enabled="false"
        android:state_pressed="true"
        android:drawable="@drawable/shape_amarelo_arredondado" />
    <item android:state_focused="true" android:state_enabled="false"
        android:drawable="@drawable/shape_amarelo_arredondado" />

    <item android:state_focused="true" android:state_pressed="true"
        android:drawable="@drawable/shape_amarelo_arredondado" />
    <item android:state_focused="false" android:state_pressed="true"
        android:drawable="@drawable/shape_amarelo_arredondado" />

    <item android:state_focused="true"
        android:drawable="@drawable/shape_amarelo_arredondado" />
</selector>

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

0 comentários:

Postar um comentário