欢迎光临
我们一直在努力

可单独设置边缘的layerborder

建站超值云服务器,限时71元/月

可单独设置边缘的layerborder

项目介绍:

后面会陆续的进行维护,后期考虑添加
目前已经支持pod 'UIView+RITLBorders'

如果有帮助,欢迎Star

  • 圆角控制

  • 渐变色边缘

目前开放的接口如下:

/// 使用layer的borderWidth统一设置
- (void)ritl_addBorderWithInset:(UIEdgeInsets)inset
                          Color:(UIColor *)borderColor
                      direction:(RITLBorderDirection)directions;

/// 使用layer的borderColor统一设置
- (void)ritl_addBorderWithInset:(UIEdgeInsets)inset
                     BorderWidth:(CGFloat)borderWidth
                      direction:(RITLBorderDirection)directions;


/// 各项的间距为UIEdgeInsetsZero
- (void)ritl_addBorderWithColor:(UIColor *)borderColor
                     BodrerWidth:(CGFloat)borderWidth
                      direction:(RITLBorderDirection)directions;

/// 自定义的layer设置
- (void)ritl_addBorderWithInset:(UIEdgeInsets)inset
                          Color:(UIColor *)borderColor
                     BorderWidth:(CGFloat)borderWidth
                      direction:(RITLBorderDirection)directions;

/// 移除当前边框
- (void)ritl_removeBorders:(RITLBorderDirection)directions;

/// 移除所有追加的边框
- (void)ritl_removeAllBorders;

上面的实例设置代码如下:

    [self.left ritl_addBorderWithColor:UIColor.blackColor BodrerWidth:2 direction:RITLBorderDirectionLeft];
    [self.top ritl_addBorderWithColor:UIColor.orangeColor BodrerWidth:2 direction:RITLBorderDirectionTop];
    [self.right ritl_addBorderWithColor:UIColor.greenColor BodrerWidth:2 direction:RITLBorderDirectionRight];
    [self.bottom ritl_addBorderWithColor:UIColor.yellowColor BodrerWidth:2 direction:RITLBorderDirectionBottom];
    
    
    #pragma mark -
    [self.leftRight ritl_addBorderWithColor:UIColor.cyanColor BodrerWidth:2 direction:RITLBorderDirectionLeft|RITLBorderDirectionRight];
    
    [self.topBottom ritl_addBorderWithColor:UIColor.purpleColor BodrerWidth:2 direction:RITLBorderDirectionTop|RITLBorderDirectionBottom];

    [self.custom ritl_addBorderWithColor:UIColor.orangeColor BodrerWidth:1.5 direction:RITLBorderDirectionLeft];
    [self.custom ritl_addBorderWithColor:UIColor.blueColor BodrerWidth:1 direction:RITLBorderDirectionTop];
    [self.custom ritl_addBorderWithColor:UIColor.redColor BodrerWidth:2 direction:RITLBorderDirectionBottom];

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 可单独设置边缘的layerborder
分享到: 更多 (0)