zoukankan      html  css  js  c++  java
  • Android selector 无效的问题

    这几天做项目,用到背景选择器,无论怎么弄, 都没有效果,找了很多资料都没有找到,样式是这样的

    <?xml version="1.0" encoding="UTF-8"?> 
    <selector xmlns:android="http://schemas.android.com/apk/res/android"> 
       <item android:drawable="@drawable/title_new_normal"/> 
        <item android:drawable="@drawable/title_new_selected" android:state_focused="true"/> 
        <item android:drawable="@drawable/title_new_selected" android:state_selected="true"/> 
        <item android:drawable="@drawable/title_new_selected" android:state_pressed="true"/> 
        <item android:drawable="@drawable/title_new_selected" android:state_enabled="false"/>     
      
    </selector>

    后来偶然间,把默认的放在最下面,就好用啦

    <?xml version="1.0" encoding="UTF-8"?> 
    <selector xmlns:android="http://schemas.android.com/apk/res/android"> 
      
        <item android:drawable="@drawable/title_new_selected" android:state_focused="true"/> 
        <item android:drawable="@drawable/title_new_selected" android:state_selected="true"/> 
        <item android:drawable="@drawable/title_new_selected" android:state_pressed="true"/> 
        <item android:drawable="@drawable/title_new_selected" android:state_enabled="false"/> 
        <item android:drawable="@drawable/title_new_normal"/> 
      
    </selector>
  • 相关阅读:
    DICOMDIR结构
    给文件夹添加Everyone用户
    关于Predicate<T>委托
    开发者必备的6款源码搜索引擎
    Create XML Files Out Of SQL Server With SSIS And FOR XML Syntax
    create xml file from sql script
    DICOM中的入门概念
    小米note开启调试模式
    [转] Java基础知识——Java语言基础
    Java语言基本语法
  • 原文地址:https://www.cnblogs.com/xuewater/p/2731112.html
Copyright © 2011-2022 走看看