博客
关于我
UI学习之点击或聚焦 或失去焦点的时候变换样式
阅读量:371 次
发布时间:2019-03-05

本文共 1550 字,大约阅读时间需要 5 分钟。

 在drawable文件夹

diff_bg.xml

<?xml version="1.0" encoding="utf-8"?>

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

 

    <item  android:state_pressed="true" 

         android:drawable="@color/focus"/>

    <item  android:state_selected="true" 

    android:drawable="@color/focus"/>

    <item  android:state_focused="true" 

    android:drawable="@color/focus"/>    

 

</selector>

layout文件夹中mail.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:mobile="http://net.blogjava.mobile"
    android:orientation="vertical"
    android:background="@drawable/
proback"
    
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<com.android.projector.IconTextView
    android:text="@string/on_projector"
    android:id="@+id/on_projector"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="100dp"
    android:background="@drawable/
diff_bg"
    android:textStyle="bold"
    android:clickable="true"
    android:focusable="true"
    android:selectable="true"
     style="@style/MayStyle"
    mobile:iconSrc="@drawable/open"
    />
<com.android.projector.IconTextView
    android:text="@string/down_projector"
    android:id="@+id/down_projector"
    android:layout_below="@id/on_projector"
    android:layout_marginTop="20dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:clickable="true"
    android:focusable="true"
    android:selectable="true"
    android:background="@drawable/
diff_bg"
     style="@style/MayStyle"
    mobile:iconSrc="@drawable/close"
    />
    
</RelativeLayout>

转载地址:http://hgsg.baihongyu.com/

你可能感兴趣的文章
MySQL中ON DUPLICATE KEY UPDATE的介绍与使用、批量更新、存在即更新不存在则插入
查看>>
MYSQL中TINYINT的取值范围
查看>>
Mysql中varchar类型数字排序不对踩坑记录
查看>>
mysql中出现update-alternatives: 错误: 候选项路径 /etc/mysql/mysql.cnf 不存在 dpkg: 处理软件包 mysql-server-8.0的解决方法(全)
查看>>
MySQL中地理位置数据扩展geometry的使用心得
查看>>
Mysql中存储引擎简介、修改、查询、选择
查看>>
mysql中实现rownum,对结果进行排序
查看>>
mysql中对于数据库的基本操作
查看>>
mysql中的 +号 和 CONCAT(str1,str2,...)
查看>>
MySql中的concat()相关函数
查看>>
mysql中的concat函数,concat_ws函数,concat_group函数之间的区别
查看>>
MySQL中的count函数
查看>>
MySQL中的DB、DBMS、SQL
查看>>
MySQL中的DECIMAL类型:MYSQL_TYPE_DECIMAL与MYSQL_TYPE_NEWDECIMAL详解
查看>>
MySQL中的GROUP_CONCAT()函数详解与实战应用
查看>>
MySQL中的IO问题分析与优化
查看>>
MySQL中的ON DUPLICATE KEY UPDATE详解与应用
查看>>
mysql中的rbs,SharePoint RBS:即使启用了RBS,内容数据库也在不断增长
查看>>
mysql中的undo log、redo log 、binlog大致概要
查看>>
Mysql中的using
查看>>