这是一个小型项目,允许通过绘制围绕它的圆形来突出显示给定的选项。
您可以设置:
[_button.dcfView setLineColor:[UIColor blueColor]];
[_button.dcfView setAnimationDuration:4.f];
[_button.dcfView drawBezierAnimated:YES];
__weak __typeof(_button)weakButton = _button;
[_button.dcfView setCompletionBlock:^{
[weakButton.dcfView setHidden:YES];
}];
[_button.dcfView setLineWidth:5.f];
[_button.dcfView setStartPosition:DCFStartPositionBottomLeft];
[_button.dcfView setBezierApproximation:2.5f];
[_button.dcfView setMarginValue:40.f];
[_button.dcfView setBackgroundColor:[UIColor colorWithWhite:0.f alpha:0.3f]];
在您项目的 git 文件夹中输入:
git submodule init
git submodule add --copy link to the repo--
git submodule update
从 DrawCircleFrame/DrawCircleFrame 文件夹复制所有文件。
这非常不建议,因为您将无法看到代码更新。请克隆或下载源代码,然后从 DrawCircleFrame/DrawCircleFrame 文件夹复制所有文件。
克隆并查看演示以获取更多关于实现的示例。您可以通过 Storyboard 或使用代码添加视图。
// in your view.h download the library
#import <DrawCircleFrame/NODCFButton.h>
#import <NOCategories/NSString+NOCSize.h>
// then add a property
@property (nonatomic) NODCFButton *button;
// alloc & init the view or setup this via storyboard
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
_button = [[NODCFButton alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
[self addSubview:_button];
}
return self;
}
// in your controller you can change outlook of the control
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
// setup all properties eg
[_dcfExampleView.button.dcfView setLineColor:[UIColor greenColor]];
// drawing happens after calling this method
[_dcfExampleView.button.dcfView drawBezierAnimated:YES];
}
Natalia Osiecka,[email protected]
Apache 2.0 许可。有关更多信息,请参阅 LICENSE 文件。
需要 Xcode 5,针对 iOS 6.0 或更高版本