原文地址:http://developer.android.com/guide/topics/resources/providing-resources.html
当应用中提供复选资源的时候,Android系统会依据当前前的系统配置,在运行过程中寻找最优的资源。下面,以这几个文件中的图片资源为例,解析Android系统定位多选资源的过程:
drawable/
draw...
分类:
移动开发 时间:
2015-01-09 12:40:55
阅读次数:
308
当开发的时候,使用开关的时候,效果不能不满足我们的需求,要表现出滑动的效果。我们就可以自定义开关。
思路:
1.把开关分为两部分,一部分是开关的背景,另一部分是滑动按钮。
2.测量开关的长和宽,当然是在onMeasure中进行处理
3.在onTouchEvent()根据触摸开关进行滑动位置进行监听,在onDraw()中进行绘画。
当然也要绘画两部分:开关背景和滑动按钮
4.对触摸位...
分类:
其他好文 时间:
2015-01-08 18:03:53
阅读次数:
209
定义控件本文以按钮为例,制作一个imagebutton,继承系统button,分四种状态1,正常状态2,获得焦点3,按下按钮4,禁用当然你得准备一张图片,包含四种状态的样式,同样你也可以准备四张图片,这取决于你如何draw按钮我们定义一个构造函数privateenumbtnState{Button_...
引自:http://blog.csdn.net/carlfan/article/details/81399841、首先说一下canvas类:Class OverviewThe Canvas class holds the "draw" calls. To draw something, you ne...
分类:
移动开发 时间:
2015-01-07 12:47:37
阅读次数:
194
View Program iOSView and Window ArchitectureThe view draw cycleWhen a view first appears on the screen, the system asks it to draw its content. The sy...
分类:
其他好文 时间:
2015-01-07 00:29:05
阅读次数:
274
// An image can be directly compositing if it's the sole content of the layer, and has no box decorations
// that require painting. Direct compositing saves backing store.
bool CompositedLayerMapping:...
分类:
其他好文 时间:
2015-01-06 18:11:08
阅读次数:
176
D3D11 WARNING #356这个傻warning的意思看起来是说vertex buffer 太小了描述是这样的: Vertex Buffer at the input vertex slot 0 is not big enough for what the Draw*() call expe...
分类:
其他好文 时间:
2015-01-06 11:36:00
阅读次数:
481
1、绘制线条:1.1、在storyboard中拖拉一个view,并设置大小;1.2、自定义一个类,继承自UIView,并与1.1中的view进行关联;1.3、- (void)drawRect:(CGRect)rect方法中实现画线条: 1 // 2 // LineView.m 3 // Draw.....
分类:
其他好文 时间:
2015-01-04 19:02:31
阅读次数:
206
拿出来直接运行即可,可以直接理解什么是GLSL,之所以贴出来是因为很多文章写得乱七八糟,一面解释,一面贴代码,有必要吗??很多GLSL电子书都有很详细的解释的。我的OpenGL框架代码可能和你的框架的有些不同,可以把init、update、draw实现拿出来即可。vertexshader.txtun...
分类:
其他好文 时间:
2015-01-03 19:46:07
阅读次数:
308
假设在项目目录下存在一个Image目录,注意其中图片已经都设置成为:生成方式为资源文件。 /// /// 得到要绘置的图片对像 /// /// 图像在程序集中的地址 /// public static System.Draw...