摘要:
package com.weidingqiang.customchinacar.views.topbar;import android.content.Context;import android.content.res.TypedArray;import android.graphics.draw... 阅读全文
posted @ 2015-11-05 15:00
weidingqiang
阅读(334)
评论(0)
推荐(0)
摘要:
上代码比较直观package com.weidingqiang.customchinacar.views.mapview;import android.content.Context;import android.graphics.Bitmap;import android.graphics.Bit... 阅读全文
posted @ 2015-11-05 13:47
weidingqiang
阅读(177)
评论(0)
推荐(0)
摘要:
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/24252901很多的Android入门程序猿来说对于Android自定义View,可能都是比较恐惧的,但是这又是高手进阶的必经之路,所有准备在自定义View上面花一些功夫,多写一些文... 阅读全文
posted @ 2015-11-05 13:43
weidingqiang
阅读(120)
评论(0)
推荐(0)
摘要:
Android中实现view的更新有两组方法,一组是invalidate,另一组是postInvalidate,其中前者是在UI线程自身中使用,而后者在非UI线程中使用。Android提供了Invalidate方法实现界面刷新,但是Invalidate不能直接在线程中调用,因为他是违背了单线程模型:... 阅读全文
posted @ 2015-11-05 13:42
weidingqiang
阅读(144)
评论(0)
推荐(0)
摘要:
View中:publicvoidlayout(intl,intt,intr,intb) { ... onLayout ...}//changed 表示是否有新的位置或尺寸protectedvoidonLayout(booleanchanged,intleft,inttop,intright,i... 阅读全文
posted @ 2015-11-05 13:41
weidingqiang
阅读(286)
评论(0)
推荐(0)
摘要:
View中:publicvoiddraw(Canvas canvas) {/*1. Draw the background 绘制背景2. If necessary, save the canvas' layers to prepare for fading 如有必要,颜色渐变淡之前保存画布层(即锁... 阅读全文
posted @ 2015-11-05 13:40
weidingqiang
阅读(441)
评论(0)
推荐(0)
摘要:
getWidth()获得的宽度是View在设定好布局后整个View的宽度getMeasuredWidth()是对View上的内容进行测量后得到的View内容占据的宽度。getWidth得到是某个view的实际尺寸.getMeasuredWidth是得到某view想要在parent view里面占的大... 阅读全文
posted @ 2015-11-05 13:38
weidingqiang
阅读(445)
评论(0)
推荐(0)
摘要:
1.Drawable—>BitmapResources res=getResources();Bitmap bmp=BitmapFactory.decodeResource(res, R.drawable.sample_0);Resources res=getResources();private ... 阅读全文
posted @ 2015-11-05 09:53
weidingqiang
阅读(453)
评论(0)
推荐(0)

浙公网安备 33010602011771号