![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android
候鸟~zZ
这个作者很懒,什么都没留下…
展开
-
java.lang.RuntimeException: Can't create handler inside thread that has not call
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() 这时今天遇到的第二个错误。 原因是非主线程中没有创建Looper对象,需要先调用Looper.prepare()启用Looper。 解决办法是在线程的开始跟结束间调用Looper.prepa...原创 2014-06-12 15:51:14 · 382 阅读 · 1 评论 -
Ant 打包Android项目 libpng error: Not a PNG file
Ant 打包Android项目 由于指定不用android sdk 工具自动生成的build.xml 文件,就自己网上搜了一堆资料, 写了个ant脚本,构建过程出现了一堆错误。下面是其中最让我郁闷的错误, [exec] libpng error: Not a PNG file [exec] ERROR: Failure processing PNG image re...2014-12-24 10:37:11 · 102 阅读 · 0 评论 -
android scaleType的属性
android scaleType的属性:matrix(默认)、center、centerCrop、centerInside、fitCenter(常用)、fitEnd、fitStart、fitXY(常用) android:scaleType="center" 保持原图的大小,显示在ImageView的中心。当原图的size大于ImageView的size,超过部分裁剪处理。 ...原创 2015-11-25 11:26:38 · 142 阅读 · 0 评论 -
android 动画调换上下布局
android 动画调换上下布局 之前使用TranslateAnimation实现,感觉复杂又不好搞,实际上用ViewPropertyAnimator 可以很简单解决。 代码如下: public void swapViewUpDown(int upViewId, final int downViewId) { final View upView = (View) findV...2015-11-25 16:55:22 · 569 阅读 · 0 评论 -
Unable to execute dex: Multiple dex files define 错误
Unable to execute dex: Multiple dex files define 错误,一般是引入的包重复了, 如: Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes; 是多引入了android-support-v4.jar ...原创 2015-11-26 08:57:37 · 157 阅读 · 0 评论 -
【笔记】android捕获触摸事件
【摘】捕获触摸事件 重写onTouchEvent()回调函数 public class MainActivity extends Activity { @Override public boolean onTouchEvent(MotionEvent event){ int action = MotionEventCompat.getAct...原创 2015-12-02 16:45:11 · 483 阅读 · 0 评论