【Objective-c】 快速集成九宫格UI
2016-10-19 本文已影响195人
MR_詹
效果图

集成方法:
StyleBox *box = [[StyleBox alloc]initWithFrame:CGRectMake(0, 20, self.view.frame.size.width, 200) Arrange:4 Rank:2];
box.titles = @[@"你",@"我",@"他",@"她",@"它",@"你",@"我",@"他",@"她",@"它"];
box.icons = @[@"投诉建议",@"投诉建议",@"投诉建议",@"投诉建议",@"投诉建议",@"投诉建议",@"投诉建议",@"投诉建议",@"投诉建议",@"投诉建议"];
box.ViewEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10); //四周边距
box.interitemSpacing = 20; //列距
box.lineSpacing = 20; //行距
box.backgroundColor = [UIColor lightGrayColor]; //背景颜色
box.delegate = self;
[self.view addSubview:box];
点击触发事件
#pragma mark - StyleBoxDelegate
- (void)StyleBoxDidSelectItemWithIndex:(NSInteger)index{
NSLog(@"=======%ld",index);
}
cell的定制

你的支持,是我最大动力!!!!!
------每篇一句:夕阳无限好(陈奕迅)