// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
UIBezierPath *path = [UI...
分类:
移动开发 时间:
2015-07-01 22:19:53
阅读次数:
259
1. snippets, 使用和创建可重用代码块:比如将以下代码可重用:#pragma mark - setup-(void)awakeFromNib{ [self setup];}-(void)setup{}-(instancetype)initWithFrame:(CGRect)frame{ s...
分类:
其他好文 时间:
2015-06-30 21:53:21
阅读次数:
122
#import "LCSView.h"
@implementation LCSView
////绘图
- (void)drawRect:(CGRect)rect
{
#if 0
//图形上下文对象
CGContextRef context = UIGraphicsGetCurrentContext();
...
分类:
移动开发 时间:
2015-06-30 18:21:10
阅读次数:
221
//确保第一区域紧贴导航栏- (void)viewWillAppear:(BOOL)animated{ CGRect frame = _tableView.tableHeaderView.frame; frame.size.height = 1; UIView *headerView = [[...
分类:
移动开发 时间:
2015-06-30 18:12:55
阅读次数:
252
利用webview显示gif动画
CGRect frame =
CGRectMake(50,50,0,0);
frame.size = [UIImage
imageNamed:@"1.gif"].size;
//
读取gif图片数据
NSData *gif = [NSData
dataWithContentsOfFile: [[NSBu...
分类:
Web程序 时间:
2015-06-26 18:13:38
阅读次数:
190
1.自定义一个 Cell,在 initWithStyle:reuseIdentifier: 构造方法中添加所有需要显示的子控件2.新建一个模型类,比如 CellFrameModel,作用是:描述一个自定义 Cell 内部所有子控件的 frame 属性* 提供一系列 CGRect 类型的属性给自定义 ...
分类:
其他好文 时间:
2015-06-26 17:29:23
阅读次数:
84
// CGPoint 结构体数据原型, 用于声明一个点; 02./* Points. */ 03.? 04.struct CGPoint { 05.CGFloat x; 06.CGFloat y; 07.}; 08.typedef struct CGPoint CGPoint; 09.? 10.typedef CGPoint NSPoint; 11.? ...
分类:
其他好文 时间:
2015-06-24 11:08:30
阅读次数:
133
一、首先列一下公认的资料:先看到下面的代码你肯定就明白了一些:123456-(CGRect)frame{returnCGRectMake(self.frame.origin.x,self.frame.origin.y,self.frame.size.width,self.frame.size.hei...
分类:
移动开发 时间:
2015-06-23 15:22:10
阅读次数:
123
?通过修改控件的frame属性就可以修改控件在屏幕上的位置和尺寸?比如点击“向上”按钮,让按钮的y值减小即可- (IBAction)top:(UIButton *)sender { CGRect btnFrame = self.headBtn.frame; btnFrame.origin.y -= ...
分类:
其他好文 时间:
2015-06-23 13:22:32
阅读次数:
100
系统定义的常用结构体NSRangeNSPoint (CGPoint)NSSize (CGSize)NSRect (CGRect)常用的结构体方法初始化NSMakeRangeCGPointMakeCGSizeMakeCGRectMake打印结构体,返回字符串- (NSString *) NSStrin...
分类:
其他好文 时间:
2015-06-17 11:16:08
阅读次数:
118