
代码片段&类的讲解
文章平均质量分 71
weixhe0210
这个作者很懒,什么都没留下…
展开
-
CollectionView上的headerView滞留问题
CollectionView上的HeaderView默认是不会想tableView一样滞留的,若想滞留,则进行一下操作:1. 创建类,继承 UICollectionViewFlowLayout 2. 在类中拷贝一下两个方法,即可- (NSArray *) layoutAttributesForElementsInRect:(CGRect)rect {原创 2015-03-16 16:54:40 · 1259 阅读 · 0 评论 -
NSScanner类的基本用法
NSScanner是一个类,用于在字符串中扫描指定的字符,尤其是把它们翻译/转换为数字和别的字符串。可以在创建NSScaner时指定它的string属性,然后scanner会按照你的要求从头到尾地扫描这个字符串的每个字符。 创建一个Scanner NSScanner是一个类族, NSScanner是其中公开的一类。通常,可以用scannerWithString:或localized转载 2015-03-16 17:27:52 · 278 阅读 · 0 评论 -
UIColor类的扩展
1. 通过16进制计算颜色+ (UIColor *)colorFromHexRGB:(NSString *)inColorString{ UIColor *result = nil; unsigned int colorCode = 0; unsigned char redByte, greenByte, blueByte; if (nil !=原创 2015-03-16 17:24:23 · 418 阅读 · 0 评论 -
UIImage 扩展功能
1. 改变图片的颜色定义image的扩展类@interface UIImage (Tint)- (UIImage *)imageWithTintColor:(UIColor *)tintColor;- (UIImage *)imageWithGradientTintColor:(UIColor *)tintColor;@end类的实现@implementation UIImag原创 2015-03-27 13:52:55 · 409 阅读 · 0 评论 -
对文件的操作
// 是否存在文件+ (BOOL)FileExistAtPath:(NSString*)_filePath{ NSFileManager * fileManager = [NSFileManager defaultManager]; if ( [fileManager fileExistsAtPath:_filePath]) { return YES;原创 2015-03-16 18:02:06 · 274 阅读 · 0 评论 -
UIBezierPath 的使用介绍
使用UIBezierPath类可以创建基于矢量的路径。此类是Core Graphics框架关于path的一个封装。使用此类可以定义简单的形状,如椭圆或者矩形,或者有多个直线和曲线段组成的形状。 1.Bezier Path 基础 UIBezierPath对象是CGPathRef数据类型的封装。path如果是基于矢量形状的,都用直线和曲线段去创建。我们使用直线段去创建转载 2015-03-26 16:35:23 · 328 阅读 · 0 评论