Sub AddDashedBorder(v As View, clr As Int)
Dim no As NativeObject = Me
no.RunMethod("addDashedBorder::", Array(v, no.ColorToUIColor(clr)))
End Sub
#if OBJC
- (void) addDashedBorder:(UIView*)v :(UIColor*) clr {
CAShapeLayer* border;
NSArray* layers = v.layer.sublayers;
if ([layers count] == 0 || [layers.lastObject isKindOfClass:[CAShapeLayer class]] == false) {
border = [CAShapeLayer layer];
[v.layer addSublayer:border];
}
else
border = layers.lastObject;
border.strokeColor = clr.CGColor;
border.fillColor = nil;
border.lineDashPattern = @[@4, @2];
border.path = [UIBezierPath bezierPathWithRect:v.bounds].CGPath;
border.frame = v.bounds;
}
#end if