1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// ProductCollectionPictureCell.m
// Lighting
//
// Created by mac on 16/5/18.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ProductCollectionPictureCell.h"
@implementation ProductCollectionPictureCell
-(id)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor=[UIColor whiteColor];
self.productImageView =[[UIImageView alloc]initWithFrame:CGRectMake(15, 0, frame.size.width-30, 2*frame.size.height/3)];
[self addSubview:self.productImageView];
self.subView=[[UIView alloc]initWithFrame:CGRectMake(0, 2*frame.size.height/3, frame.size.width, frame.size.height/3)];
[self.subView setBackgroundColor:[UIColor whiteColor]];
[self addSubview:self.subView];
// 产品描述
self.productDesce=[[UILabel alloc]initWithFrame:CGRectMake(0,0, frame.size.width, frame.size.height/9)];
self.productDesce.text=@"名称描述";
self.productDesce.textColor=[UIColor grayColor];
self.productDesce.font=[UIFont systemFontOfSize:12];
self.productDesce.textAlignment=NSTextAlignmentCenter;
[self.subView addSubview: self.productDesce];
// 产品参数
self.productParameter=[[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height/9, frame.size.width, frame.size.height/9)];
self.productParameter.textAlignment=NSTextAlignmentCenter;
self.productParameter.textColor=[UIColor grayColor];
self.productParameter.font=[UIFont systemFontOfSize:12];
[self.subView addSubview: self.productParameter];
// 产品价格
self.productPrice=[[UILabel alloc]initWithFrame:CGRectMake(0, 2*frame.size.height/9,frame.size.width, frame.size.height/9)];
self.productPrice.textColor=[UIColor grayColor];
self.productPrice.font=[UIFont systemFontOfSize:12];
self.productPrice.textAlignment=NSTextAlignmentCenter;
[self.subView addSubview: self.productPrice];
self.productModel=[[TOGoodsEntity alloc]init];
}
return self;
}
@end