大家知道,我们在开发一款产品的时候为了达到良好的用户体验,我们可以在应用中适当的加上一些动画效果,譬如平移、缩放、旋转等等,但是这些常用的动画在Android很早期的版本中就存在了,我们称之为传统动画,传统动画一般分为Tween动画和Frame动画,这也是我们最常用的的动画,统称为Animation。传统的Animation动画实现上是通过不停的调用View的onDraw方法来重新绘制View来实现的。
在Android3.0以后,Google为Android新增了属性动画框架Animator,为什么叫做属...
分类:
移动开发 时间:
2015-03-20 11:01:14
阅读次数:
177
Juliano is a fan of the TV show Erasing and Winning, where participants are selected in a draw and receive money for taking part in the show.In the sh...
public void drawRoundRect (RectF rect, float rx, float ry, Paint paint)
Draw the specified round-rect using the specified paint. The roundrect will be filled or framed based on the Style in the paint...
分类:
其他好文 时间:
2015-03-19 20:26:06
阅读次数:
165
今天被一个简单的TextView布局搞晕了,代码如下: 现在效果及我的疑问如下:显而易见,文字是居于去掉drawableStart后的空间居中。那么TextView是如何实现的呢?仔细阅读TextView的源码,很容易发现在onDraw中,它做了一个canvas的translate代码如下: ...
分类:
其他好文 时间:
2015-03-19 18:16:37
阅读次数:
160
枚举的基本用法 Enumerations
Enumeration
enum SomeEnumeration{
case enumeration1
case enumeration2
case enumeration3
...
}
import UIKit
enum GameEnding{
case Win
case Lose
case Draw
}
...
分类:
编程语言 时间:
2015-03-19 11:37:25
阅读次数:
142
《精通GDI编程》里的代码,在学习过程中对它加以总结,以防以后用到,所有代码都是在MFC 单文档中实现的,写在View::OnDraw(CDC */*pDC*/)中
画线/边框(Pen)
1、画单线-------DrawLine
[cpp] view
plaincopy
Pen pen(Color(255,0,0,0),3);...
分类:
其他好文 时间:
2015-03-18 18:10:23
阅读次数:
565
向原创致敬http://blog.csdn.net/chenggong2dm/article/details/25594059Atlas是NGUI的图集。我的理解是:Atlas把你的一些零散的图片,合并成一张图。这样做的好处是,可以降低Draw Call。我不了解它的底层运作机制,我猜应该也是再行进...
分类:
其他好文 时间:
2015-03-18 17:43:21
阅读次数:
166
笑对人生,能穿透迷雾;笑对人生,能坚持到底;笑对人生,能化解危机;笑对人生,能照亮黑暗。
本讲内容:自定义View(可以在布局文件多次用)
一、步骤:
1、自定义View的属性
2、在View的构造方法中获得我们自定义的属性
3、重写onMesure
(可有可无,一般需要重写,无写默认调用系统提供的)
4、重写onDraw
注意:
第二步:我们重写了3个构造...
分类:
移动开发 时间:
2015-03-17 16:01:27
阅读次数:
182
转载csdnTexture Atlas我为什么应该使用Texture Atlas?使用Atlas是一个普遍的好做法,而且它有很多好处。当有某些需要在屏幕渲染的时候,它背后带来的是draw call。由于不同的原因(例如渲染状态改变),一个draw call是一个很慢的操作,因此我们需要保持较低的dr...
分类:
Web程序 时间:
2015-03-16 22:40:33
阅读次数:
129
在Android关于Canvas的API描述中,一开始就如下描述:
To draw something, you need 4 basic components: A Bitmap to hold the pixels, a Canvas to host the draw calls (writing into the bitmap),
a drawing primitive (e....
分类:
其他好文 时间:
2015-03-14 15:23:18
阅读次数:
120