Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

android - Create a selector of styles

I would like to create an xml selector of styles.

Basically i would do something like that:

<selector xmlns:android="http://schemas.android.com/apk/res/android">  
  <item android:state_pressed="true"
      style="@style/filter_btn"/>
  <item android:state_pressed="false"
      style="@style/transparent" />
</selector>

Could someone help me ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Selectors work only for drawables, not styles.

Reference


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...