自定义复选框类。
继承自 UIControl 类。
此复选框不带关联的标签,这是因为有时您可能不需要在旁边放置标签,可能需要图像。因此为了补偿这一点,有一种方法可以将 UIView(或子对象)链接到它并扩展其功能。
到目前为止,只有两种类型的复选框
MPCheckBox.h
类。注意:每个复选框都有一个标识符,该属性可以从 IB 分配。
#import "MPCheckBox.h" //Import header
@class SomeClass() <MPCheckBoxDelegate> // Implement Delegate (OPTIONAL)
MPCheckBox *checkBox = [[MPCheckBox alloc] initWithFrame:someFrame];
checkBox.identifier = @"someIdent";
checkBox setDelegate:self];
[checkBox setCompanionView:someView]; //Can be anything that inherits from UIView
//For circular
[checkBox setCircular:YES]; //Default is NO
//Set State
[checkBox setState:kMPCheckBoxStateChecked animated:NO]; // Default is Unchecked
//Cutomization
[checkBox setBackgroundColor:someColor]; //Default Clear
[checkBox setBorderColor:otherColor]; //Default Black
[checkBox setCheckColor:oneMoreColor]; //Default Black
//The state can be toggled manually from anywhere just call
[checkBox toggleState:YES];
[someOtherView addSubView:checkBox];
NSArray* checkBoxes = @[leftmostCheckBox, leftCheckBox, rightCheckBox, rightmostCheckBox];
MPCheckBoxGroup* checkBoxGroup = [[MPCheckBoxGroup alloc] init];
[checkBoxGroup setCheckBoxes:checkBoxes];
[checkBoxGroup setDelegate:self];
[checkBoxGroup setIdentifier:@"group"];
MIT,但请阅读 de LICENSE 文件以获取更多信息。
<<<<<<< HEAD
v0.1.3 ~ 未来的方法名和属性可能会更改。将会指定它们,但请提前警告。
v0.1.3