一组按钮,可以用来实现多重选项组件
设置填充
MSButtonConfigurationModel
@property (nonatomic, assign) CGFloat edgeMargin
leading 和 trailing 填充。
最左边的button和最右边的button距离组件两侧边缘的距离
@property (nonatomic, assign) CGFloat horMargin
button之间的水平填充。
水平方向上button与button之间的距离
@property (nonatomic, assign) CGFloat verMargin
button之间的垂直填充。
垂直方向上button与button之间的距离
@property (nonatomic, assign) CGFloat buttonHeight
button的高度。
button的高度
@property (nonatomic, assign) CGFloat fromTopMargin
top填充。
组件的top距离父view的top的距离。
@property (nonatomic, assign) CGFloat componentWidth
组件的宽度。
组件的宽度
@property (nonatomic, getter=isHide) BOOL hide
初始化时隐藏。
初始化时是否隐藏。
@property (nonatomic, assign) NSInteger numberInaLine
每一行的button数量。
每一行的button数量
MSButtonConfigurationModel *configuration = [[MSButtonConfigurationModel alloc] initWithEdgeMargin:0.0f
horMargin:10.0f
verMargin:10.0f
buttonHeight:32.0f
fromTopMargin:160
componentWidth:[[UIScreen mainScreen] bounds].size.width
numberInALine:4];
初始化buttonList
MSMarksButtonList *buttonList = [[MSMarksButtonList alloc] initWithDataSource:[NSArray array]
buttonType:MSButtonTypeOrderScore
configuration:configuration];
提示 我必须将你的数据模型转换为button模型(MSButtonModel),像以下示例所示。
MSMarksButtonList 通过 CocoaPods 提供支持。要安装它,只需将以下行添加到 Podfile 中:
pod "MSMarksButtonList"
MSMarksButtonList 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。