// // TCFaceView.m // QimoQM // // Created by TuChuan on 15/5/13. // Copyright (c) 2015年 七陌科技. All rights reserved. // #import "TCFaceView.h" #define NumPerLine 7 #define Lines 3 #define FaceSize 34 /* ** 两边边缘间隔 */ #define EdgeDistance 20 /* ** 上下边缘间隔 */ #define EdgeInterVal 5 @implementation TCFaceView - (id)initWithFrame:(CGRect)frame forIndexPath:(int)index { self = [super initWithFrame:frame]; if (self) { // 水平间隔 CGFloat horizontalInterval = (CGRectGetWidth(self.bounds)-NumPerLine*FaceSize -2*EdgeDistance)/(NumPerLine-1); // 上下垂直间隔 CGFloat verticalInterval = (CGRectGetHeight(self.bounds)-2*EdgeInterVal -Lines*FaceSize)/(Lines-1); NSString *bundlePath = [[NSBundle mainBundle]pathForResource:@"QMEmoticon" ofType:@"bundle"]; for (int i = 0; i