CGFloat itemW = ((kScreenW -30)-2*Scale(15))/4.0;
NSArray *titles = @[@"浏览记录",@"我的认证",@"我的订单",@"邀请有奖"];
NSArray *imgs = @[@"my_profileFisrt",@"my_profileSecond",@"my_profileThird",@"my_profileFouth"];
for (int i=0; i<titles.count; i++) {
UIButton *btn = [[UIButton alloc]init];
CGFloat btnX = itemW * i + Scale(15);
CGFloat btnY = 0;
btn.frame = CGRectMake(btnX,btnY, itemW, itemW);
btn.tag = 1000 + i;
btn.titleLabel.font = LYFont(Scale(14));
[btn setImage:ImageNamed(imgs[i]) forState:UIControlStateNormal];
[btn setTitle:titles[i] forState:UIControlStateNormal];
[btn setTitleColor:LYHexColor(@"#999999") forState:UIControlStateNormal];
[btn addTarget:self action:@selector(functionBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self.backgView addSubview:btn];
[btn layoutButtonWithEdgeInsetsStyle:JTButtonEdgeInsetsStyleTop imageTitleSpace:5];
}
网友评论