定义xml为drawable文件并根据状态改变显示的图片资源
在Button上触摸按下的时候,Button有focused,pressed和default状态,可以使用不同的图片来显示这三种状态。
先定义一个名为btnselector.xml文件,代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
android:state_pressed="false"
android:drawable="@drawable/focused"
></item>
<item
android:state_focused="true"
android:state_pressed="true"
android:drawable="@drawable/focusedpressed"
></item>
<item
android:state_focused="false"
android:state_pressed="true"
android:drawable="@drawable/pressed"
></item>
<item
android:drawable="@drawable/default"
></item>
</selector>
ImageButton使用btnselector.xml如下:
<ImageButton
android:id="@+id/stop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/btnselector"
android:background="#00000000"
></ImageButton>
android:src赋值为"@drawable/btnselector",而不是指向具体的图片资源。
相关文档:
由于现在在公司负责制作标准的静态页面,为了增强客户体验,所以经常要做些AJAX效果,也学你也和我一样在,学习AJAX。而设计AJAX时使用的一个重要的技术(工具)就是XMLHTTPRequest对象了。这里海啸把我学习XMLHTTPRequest对象的一点资料拿出来跟大家一起分享。文中的资料都是海啸在学习时在网上收集的,如果您开过,那就再 ......
XML的全称Extensible Markup Language,意思是可扩展的标记语言,是标准通用标记语言SGML(Standard Generalized Markup Language)的一个子集。1998年2月,W3C发布了XML1.0标准,其目的是为了在Web上能以现有的超文本标记语言HTML的使用方式提供,接收和处理通用的SGML。XML是SGML的一个简化子集,它以一种开放的,自我描述的 ......
一些字符在 URL 或 XML 文档中使用时有特殊的含义,因此必须针对这些含义对字符做适当编码以使其生效。
URL 中的特殊字符
在 URL 上执行的查询中,特殊字符被指定为 %xx,其中 xx 是字符的十六进制值。下表列出了这些特殊字符并描述了它们的含义。有关更多信息,请参见 http://www.faqs.org/rfcs/rfc1738.html 中的 RFC ......
不需要生成dtd,无用配置,不需要生成辅助类,速度快。这就是xstream+xpp超强黄金组合。
xstream大家都知道啦,XML Pull Parser是一种高速的 解析xml文件的方式,速度要比传统方式快很多(发现pull式解析现在比较流行了)。下面我给出多种使用方法的例子。
1.最简单的使用方法
因为这个太简单,所以我从moogle的blog http: ......
---xml拆分以不定空格为分割符号的字符串
--测试数据
if object_id('[tb]') is not null drop table [tb]
create table [tb]([a] varchar(200))
go
insert [tb]
select 'aaaa bbbb cccc dddd'
insert [tb]
select 'eeeeee ffff hhhh   ......