2016-09-20 3 views

답변

-1

내가 선택한 항목의 텍스트 색에 대해 부탁 해요

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

<item android:state_activated="true" android:drawable="@color/selected_spinner_item"/> 

<item android:drawable="@drawable/normalwhatever"/> 
+0

...

<Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="@dimen/spinner_height" android:background="@drawable/spinner_bg" android:divider="@drawable/list_divider" android:drawSelectorOnTop="true" android:popupBackground="@color/spinner_popup"/> 

이 같은 UR spinner_bg.xml 보이게, 이것은 당신이 사용하고있는 Spinner 가정하자. 배경이 아닙니다. –

+0

이것을 사용해 보셨습니까? spinner_bg.xml의 다섯 번째 줄은 활성화 된 항목의 'textColor'를 나타냅니다. 시도하고 업데이트하십시오. 'item android : state_activated = "true"android : color = "@ color/selected _spinner_item"/>' – Mithun

+0

예! 그리고 이것은 작동하지 않습니다. 더 많은 것은 drawable 대신 color tag를 사용하기 때문에 충돌이 발생합니다. –

관련 문제