- (void)createBackView{
UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(Width(10), 0, kScreenWidth-Width(20), m_frame.size.height -Height(10))];
backView.backgroundColor = [UIColor whiteColor];
//阴影
backView.layer.shadowColor = [UIColor blackColor].CGColor;
backView.layer.shadowOffset =CGSizeMake(1, 2);
backView.layer.shadowOpacity = 0.15;
backView.layer.shadowRadius =3.0;
backView.clipsToBounds =NO;
backView.layer.cornerRadius = 5;
[self addSubview:backView];
_backView = backView;
}
- (void)refreshArr:(NSMutableArray *)dataArr {
NSLog(@"dataArr==------====%@",dataArr);
[[_backView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
for (NSInteger i=0; i<dataArr.count; i++) {
Capital_BussinessItem *itme = [[Capital_BussinessItem alloc]init];
CGFloat width =(_backView.frame.size.width-Width(15)-Height(10))/3;
CGFloat x = Width(7.5) + width*(i%3) + Height(5)*(i%3);
CGFloat y = Height(20)*(i/3) + Height(5)*(i/3) +Height(12);
CGFloat height = Height(20);
itme.frame =CGRectMake(x, y, width, height);
itme.dict = dataArr[i];
itme.tag = 555+i;
[_backView addSubview:itme];
UITapGestureRecognizer *labelTapGestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(labelTouchUpInside:)];
[itme addGestureRecognizer:labelTapGestureRecognizer];
}
}