select_drawble.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="@drawable/main_index_search_pressed"></item>
    <!-- 正常情况下的图片 -->
    <item android:drawable="@drawable/main_index_search_normal"></item>

</selector>
    <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:background="@drawable/select_drawble"
            android:onClick="clickIV" />

selector + drawable 多状态图形的更多相关文章

  1. AndroidTips:selector的disable状态为什么无效?

    正确的姿势: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android=& ...

  2. android 代码生成selector drawable

    public static StateListDrawable makeSelector(Context context, int idNormal, int idPressed, int idFoc ...

  3. Android学习笔记_61_手机安全卫士知识点归纳(1)状态/形状图形 GPS 设备管理器DeviceAdminReceiver ImageView属性

    1.在做程序自动安装更新的时候 ,必须保证程序的签名和包名是相同.  C:\Documents and Settings\zehua\.android  \ debug.keystore  debug ...

  4. Drawable(7)让一个没有pressed状态的控件使用StateList,显示pressed图片。

    TextView没有按下状态,Button有. 如图1,内容1在一个TextView上,默认它并没有按下状态. 如何让TextView有呢. 在xml中加入属性: android:clickable= ...

  5. Android - Resource 之 Drawable小结

    本篇直接选择性地翻译官方开发指南 ============================= Drawable有十种类型,如下 (1) - Bitmap file:这个简单,也可以用xml来更详细的定 ...

  6. Drawable子类之——StateListDrawable (选择器)

    Drawable子类之——StateListDrawable (选择器) https://www.jianshu.com/p/7257ce82c762 本文出自 “阿敏其人” 简书博客,转载或引用请注 ...

  7. Android学习笔记_42_各种图形的炫酷效果的实现和使用

    一.文档位置: 这里在android中的图形,在帮助文档的这个页面,  android-sdk-windows\docs\guide\topics\resources\drawable-resourc ...

  8. shape-自绘制简单图形

    shape 可以绘制简单的图形,颜色等.它主要就是应用于selector 的一些状态. 本文内容参考自http://www.cnblogs.com/cyanfei/archive/2012/07/27 ...

  9. 安卓权威编程指南-笔记(第21章 XML drawable)

    在Andorid的世界里,凡事要在屏幕上绘制的东西都可以叫drawable,比如抽象图形,Drawable的子类,位图图形等,我们之前用来封装图片的BitmapDrawable就是一种drawable ...

随机推荐

  1. Android内存泄露自动检测神器LeakCanary

    经典的面试题: a.怎样在coding过程中避免内存泄露? b.怎样检测内存泄露? 这两个问题我想大部分Android 职位面试时都会被问到吧. 怎样避免就不赘述了,网上很多答案. 工具呢,当然也有很 ...

  2. SQL must not be null(低级错误)

    提醒一下: 数据库数据源配置出错,也会发生这种低级错误的.

  3. TensorFlow笔记二:线性回归预测(Linear Regression)

    代码: import tensorflow as tf import numpy as np import xlrd import matplotlib.pyplot as plt DATA_FILE ...

  4. Project Euler:Problem 89 Roman numerals

    For a number written in Roman numerals to be considered valid there are basic rules which must be fo ...

  5. Git相关命令教程

    一.在GitHub上创建新项目 (1)在GitHub首页 “New repository”,创建新版本库“test” (2)在本地使用GitBash,将repository clone到本地 git ...

  6. ps快捷键记录

    alt+delete  前景色填充 ctrl+delete  背景色填充 alt+shift+鼠标调节  变换选取,做圆环 ctrl+t  自由变换 alt+鼠标拖动  快捷复制某区域 delete ...

  7. javascript---》Fcuntion对象

    Function 对象的valueOf() 和 toString() 方法.返回函数的源代码,调试时有用 Function 对象的 length 属性返回函数期望的参数个数------>接受任意 ...

  8. (九)jQuery中的动画(载)

    原文链接:http://blog.csdn.net/zfy865628361/article/details/50358367 首先,用jQuery做动画效果要求在标准模式下,否则可能会引起动画抖动. ...

  9. TPM:dTPM(硬件)和fTPM(固件模拟的软件模块)

    转:Bitlocker.TPM和系统安全 自从微软在Windows Vista首次引入Bitlocker以来,它已经越来越多的出现在我们的周围.尤其是企业用户,Bitlocker的保护已经变得不可缺少 ...

  10. List集合的遍历方法

    估计你永远都不会忘记这三个方法了...... public static void main(String[] args) { //超级for循环遍历方法 List<String> lis ...