博客
关于我
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执行SQL文件出现【Unknown collation ‘utf8mb4_0900_ai_ci‘】的解决方案
查看>>
Mysql执行update by id的过程
查看>>
mysql执行计划
查看>>
MySQL执行计划 EXPLAIN参数
查看>>
MySQL执行计划【explain】,看这一篇就够啦!
查看>>
Mysql执行计划字段解释
查看>>
mysql执行计划怎么看
查看>>
MySQL执行计划解读
查看>>
mysql执行顺序与索引算法
查看>>
mysql批量update优化_Mysql中,21个写SQL的好习惯,你值得拥有呀
查看>>
mysql批量update操作时出现锁表
查看>>
MYSQL批量UPDATE的两种方式
查看>>
mysql批量修改字段名(列名)
查看>>
MySQL批量插入数据遇到错误1213的解决方法
查看>>
mysql技能梳理
查看>>
MySQL报Got an error reading communication packets错
查看>>
Mysql报错Can‘t create/write to file ‘/tmp/#sql_3a8_0.MYD‘ (Errcode: 28 - No space left on device)
查看>>
MySql报错Deadlock found when trying to get lock; try restarting transaction 的问题解决
查看>>
MySQL报错ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘
查看>>
Mysql报错Packet for query is too large问题解决
查看>>