[置顶]高兴,我的博客诞生了!
posted @ 2010-03-13 17:01 李克华 阅读(62) 评论(0) 编辑
在项目中,使用svn删除一个文件,可是在提交的时候总是保错,错误信息如标题。我于是在网上搜N多解决方案,发现每个都不适合我。
于是我反复试验,先更新,然后提交,嘿,还真好了,mark一下 ,希望能帮助需要帮助的人。
posted @ 2012-05-29 09:31 李克华 阅读(73) 评论(1) 编辑
在做地图的时候 有个需求:
当可以缩放地图的时候,放大按钮可以使用。当不可以使用地图的时候,放大按钮不可以使用。放大按钮在默认状态下是一个背景,点击的状态下是另一个背景。
废话少说,代码奉上:
一、ImageView配置文件片段。
<ImageView
android:id="@+id/ivZoomOut"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginRight="10px"
android:layout_marginBottom="10px"
android:src="@drawable/zoom_out_2"
/>
二、样式控制配置文件zoom_out_2.xml:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Disabled --> <item android:state_enabled="false" android:state_pressed="false" android:textColor="@color/red" android:drawable="@drawable/zoom_out_disable" /> <!-- Pressed --> <item android:state_enabled="true" android:state_pressed="true" android:textColor="@android:color/white" android:drawable="@drawable/zoom_out_pressed" /> <!-- Focused --> <!-- <item android:state_enabled="true" android:state_focused="true" android:textColor="@android:color/white" android:drawable="@drawable/list_item_focused" /> --> <!-- Default --> <item android:state_enabled="true" android:state_pressed="false" android:drawable="@drawable/zoom_out_default"/> </selector>
三、代码控制:
if(**){
zoomOutView.setEnabled(false);
}else{
zoomOutView.setEnabled(true);
}
posted @ 2012-05-24 15:35 李克华 阅读(223) 评论(2) 编辑
一个图片加载到内存里,其实是有两部分数据组成,一部分是图片的相关描述信息,另一部分就是最重要的像素信息(这部分是有byte数组组成的),android系统为了提高对图片的处理效率,对于图片的处理都是调用了底层的功能(由C语言实现的),也就是说一个图片加载到内存里后是使用两部分的内存区域,简单的说:一部分是java可用的内存区,一部分是c可用的内存区,这两个内存区域是不能相互直接使用的,
这个bitmap对象是有java分配的,当然不用的时候系统会自动回收了,可是那个对应的C可用的内存区域jvm是不能直接回收的,这个只能调用底层的功能释放。所以你要调用recycle方法来释放那一部分内存。
posted @ 2012-04-28 12:01 李克华 阅读(308) 评论(2) 编辑
一:多字段排序 可以如下构造Sort。
example.displayHits(allBooks,
new Sort(new SortField[]{
new SortField("category"),
SortField.FIELD_SCORE,
new SortField("pubmonth", SortField.INT, true)
}));
备注:knowing that sorting by a String is the most expensive type in terms
of resources(对字符型数据排序是最耗资源的)
-------参考<<Lucene in Action>>。
posted @ 2012-04-21 11:24 李克华 阅读(12) 评论(0) 编辑
唉 今天跟我女朋友分手了 四年多的恋爱说没有就没有了 悲哀 ! mark一下,权当纪念一下吧!虽然很舍不得,但又有什么办法呢?
posted @ 2012-04-15 21:53 李克华 阅读(31) 评论(2) 编辑
posted @ 2012-04-06 13:11 李克华 阅读(106) 评论(0) 编辑
posted @ 2012-04-06 13:08 李克华 阅读(159) 评论(0) 编辑
posted @ 2012-03-30 17:32 李克华 阅读(180) 评论(0) 编辑
posted @ 2012-03-22 20:44 李克华 阅读(110) 评论(1) 编辑
posted @ 2012-02-29 10:03 李克华 阅读(72) 评论(0) 编辑