最近遇到了一个问题,当写一个自定义属性控件的时候,设置的属性传入的图片可以改变。
开始的思路是:自定义的属性为integer类型,那么调用处写如对应图片在res下的id,但是当clean的时候,这个id有可能会改变,所以不能传入id。
所以现在更改为:在设置的自定义属性的地方传入res下对应图片的名字,那么再加载此图片,但是遇到了问题,没有方法直接通过名字来获取对应图片的对象。
下面就介绍加...
分类:
其他好文 时间:
2014-12-29 18:26:43
阅读次数:
122
1.includes\lib_goods.php,在最末尾添加几个function/**
* 获得指定分类下的子分类
*
* @access public
* @param integer $cat_id 分类编号
* @return array
*/
function get_children_tree($cat_id)
{
if ($cat_id >0 )...
分类:
其他好文 时间:
2014-12-29 16:56:39
阅读次数:
223
HashMap是java里比较常用的一个集合类,我比较习惯用来缓存一些处理后的结果。最近在做一个Android项目,在代码中定义这样一个变量,实例化时,Eclipse却给出了一个 performance 警告。 ? 意思就是说用SparseArr...
分类:
其他好文 时间:
2014-12-29 15:42:15
阅读次数:
143
Matrix Power Series
Time Limit: 3000MS
Memory Limit: 131072K
Total Submissions: 15997
Accepted: 6840
Description
Given a n × n matrix A and a positive integer k, ...
分类:
其他好文 时间:
2014-12-29 15:24:28
阅读次数:
160
Fibonacci
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9769
Accepted: 6959
Description
In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = F...
分类:
其他好文 时间:
2014-12-29 15:23:38
阅读次数:
107
Given an integer array, heapify it into a min-heap array.For a heap array A, A[0] is the root of heap, and for each A[i], A[i * 2 + 1] is the left chi...
1、挂起,不占CPUsleep2、不挂起,占cpuprocedure Delay(msecs:integer);varFirstTickCount:longint;beginFirstTickCount:=GetTickCount;repeatApplication.ProcessMessages;...
Exercise 6-1. write a program that will prompt for and read a positive integer less than1,000 from the keyboard, and then create and output a string t...
分类:
其他好文 时间:
2014-12-28 23:33:48
阅读次数:
190
【题目】
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and use...
分类:
其他好文 时间:
2014-12-28 22:21:58
阅读次数:
242
题目描述:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see be...
分类:
其他好文 时间:
2014-12-28 18:06:00
阅读次数:
167