------Java培训、Android培训、iOS培训、.Net培训、期待与您交流! -------oc中的结构体主要有CGPoint,CGSize,CGRect,NSRange;/* Points. */struct CGPoint { CGFloat x; CGFloat y;};typede...
分类:
其他好文 时间:
2014-09-22 13:29:32
阅读次数:
185
.h文件:#import @interface YLYTabBar : UIView@end.m文件#import "YLYTabBar.h"@implementation YLYTabBar- (id)initWithFrame:(CGRect)frame{ self = [super in...
分类:
移动开发 时间:
2014-09-20 14:56:58
阅读次数:
230
/* rect(x,y,width,height); width, height正负代表了从原点的绘制方向,矩形的长宽都是取得绝对值 */ // Do any additional setup after loading the view, typically from a nib.#prag...
分类:
其他好文 时间:
2014-09-19 13:39:25
阅读次数:
286
这些是在CGGeometry.h里的 CGPoint、CGSize、CGRect、CGRectEdge实际上都是结构体struct CGPoint { CGFloat x; CGFloat y;};typedef struct CGPoint CGPoint;struct CGSize { CGFl...
分类:
其他好文 时间:
2014-09-18 13:07:15
阅读次数:
243
一、重写 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
转自:http://blog.csdn.net/li6185377/article/details/8131042一般自定义View 代码方式 有 在初始化的时候添加 子Views[cpp]view plaincopy-(id)initWithFrame:(CGRect)frame{self=[su...
分类:
其他好文 时间:
2014-09-15 12:37:18
阅读次数:
217
#pragma mark - 创建引导页+ (id)initWithFrame:(CGRect)frame{ return [[self alloc] initWithFrame:frame];}//- (id)initWithFrame:(CGRect)frame{ self = [s...
分类:
其他好文 时间:
2014-09-13 22:39:26
阅读次数:
213
//当你通过代码创建控件就会调用这个方法- (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { [self setup]; } return self;}//当你通过storyboared或...
分类:
其他好文 时间:
2014-09-11 22:19:52
阅读次数:
273
实现自定义View的关键是重载UIView的drawRect: 方法,因为主要是通过重载这个方法,来改变view的外观。例如:- (void)drawRect:(CGRect)rect { // 绘图 CGRect bounds = [self bounds]; // Where ...
分类:
其他好文 时间:
2014-09-05 00:53:10
阅读次数:
274
iOS的文字高度计算一直是个问题, 苹果也一直在改, 这几天看了一下boundingRectWithSize方法.- (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options context:(...
分类:
其他好文 时间:
2014-09-04 13:13:19
阅读次数:
314