码迷,mamicode.com
首页 >  
搜索关键字:drawrect    ( 392个结果
小日本国旗 计算成绩总分
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); //起点移动到(0,0) CGContextMoveToPoint(context, 0, 0); //画线到(100,...
分类:其他好文   时间:2014-09-22 22:22:23    阅读次数:208
Chapter 5 带颜色的同心圆
一、重写 DrwaRect-(void)drawRect:(CGRect)rect{ CGRect bounds = self.bounds; CGPoint center; center.x = bounds.origin.x + bounds.size.width / ...
分类:其他好文   时间:2014-09-16 14:12:50    阅读次数:200
windows 随机矩形绘制
windows 随机矩形绘制 代码如下 #include void DrawRect (HWND hwnd); int cxClient, cyClient; LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstan...
分类:Windows程序   时间:2014-09-16 00:21:09    阅读次数:255
initWithFrame和initWithCoder使用技巧,以及他们什么时候被调用,自定义控件必须具备三个方法initWithFrame和initWithCoder以及drawRect
//当你通过代码创建控件就会调用这个方法- (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { [self setup]; } return self;}//当你通过storyboared或...
分类:其他好文   时间:2014-09-11 22:19:52    阅读次数:273
涂鸦-每次调setNeedsDisplay以后就会重新调用一次drawRect方法,每次调drawRect方法就会把之前画好的东西删掉
//// WJView.m// zwj涂鸦//// Created by zwj on 14-9-9.// Copyright (c) 2014年 zwj. All rights reserved.//#import "WJView.h"@interface WJView()@property(no...
分类:其他好文   时间:2014-09-11 20:47:32    阅读次数:183
IOS 用drawRect 画表格
自定义一个View DrawLineDrawLine.h#import @protocol gridTouchDelete - (void)gridTouchColumn:(NSInteger)column touchRow:(NSInteger)row;@end@interface DrawLin...
分类:移动开发   时间:2014-09-10 15:38:50    阅读次数:230
UIView常用的一些方法小记之setNeedsDisplay和setNeedsLayout
1,UIView的setNeedsDisplay和setNeedsLayout方法 首先两个方法都是异步执行的。而setNeedsDisplay会调用自动调用drawRect方法,这样可以拿到 UIGraphicsGetCurrentContext,就可以画画了。而setNeedsLayout会.....
分类:其他好文   时间:2014-09-05 21:06:01    阅读次数:238
自定义View相关
实现自定义View的关键是重载UIView的drawRect: 方法,因为主要是通过重载这个方法,来改变view的外观。例如:- (void)drawRect:(CGRect)rect { // 绘图 CGRect bounds = [self bounds]; // Where ...
分类:其他好文   时间:2014-09-05 00:53:10    阅读次数:274
简单绘画实现 点、线、面
使用绘画 必须在 -(void)drawRect:(CGRect)rect 中使用例子:- (void)drawRect:(CGRect)rect{ CGContextRef context=UIGraphicsGetCurrentContext(); CGColorSpaceR...
分类:其他好文   时间:2014-09-02 22:36:35    阅读次数:415
【转】Phone重绘机制drawRect
Phone重绘机制drawRect如何使用iPhone进行绘图、重绘操作iPhone的绘图操作是在UIView类的drawRect方法中完成的,所以如果我们要想在一个UIView中绘图,需要写一个扩展UIView 的类,并重写drawRect方法,在这里进行绘图操作,程序会自动调用此方法进行绘图。下...
分类:其他好文   时间:2014-08-30 18:54:59    阅读次数:171
392条   上一页 1 ... 34 35 36 37 38 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!