1.0.0"/>

LGDrawer

加入收藏
已有 1 人收藏

介绍:
    LGDrawer

    利用 LGDrawer 封装好的方法,可以传入参数,然后绘制出各种不同样式的 UIImage。(正方形,心形,五角星,三角形,加减号等)

    示例:绘制一个正方形

    #import "LGDrawer.h"

    UIImage *rectangle = [LGDrawer drawRectangleWithImageSize:CGSizeMake(90.f, 90.f)

     size:CGSizeMake(60.f, 60.f)

     offset:CGPointZero

     rotate:0.f

     roundedCorners:UIRectCornerBottomLeft|UIRectCornerTopRight

     cornerRadius:10.f

     backgroundColor:[UIColor whiteColor]

     fillColor:[UIColor blueColor]

     strokeColor:[UIColor blackColor]

     strokeThickness:2.f

     strokeDash:@[@4.f, @2.f] // first - length of line, second - length of space | you can use more arguments in array

     strokeType:LGDrawerStrokeTypeCenter

     shadowColor:[UIColor colorWithWhite:0.f alpha:0.5]

     shadowOffset:CGPointMake(2.f, 2.f)

     shadowBlur:6.f]

    

    安装:

    1、支持cocoapods

    podfile 文件中增加以下一行,

    pod 'LGDrawer',然后执行pod install。

    2、支持Carthage

    Cartfile 文件中增加以下一行

    github "Friend-LGA/LGDrawer" ~> 1.0.0

测试环境:
  [Code4App]编译测试
效果图:
  • iOS / iPhone / iPad LGDrawer<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;利用 LGDrawer 封装好的方法,可以传入参数,然后绘制出各种不同样式的 UIImage。(正方形,心形,五角星,三角形,加减号等)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;示例:绘制一个正方形<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;#import "LGDrawer.h"<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;UIImage *rectangle = [LGDrawer drawRectangleWithImageSize:CGSizeMake(90.f, 90.f)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                                     size:CGSizeMake(60.f, 60.f)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                                   offset:CGPointZero<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                                   rotate:0.f<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                           roundedCorners:UIRectCornerBottomLeft|UIRectCornerTopRight<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                             cornerRadius:10.f<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                          backgroundColor:[UIColor whiteColor]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                                fillColor:[UIColor blueColor]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                              strokeColor:[UIColor blackColor]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                          strokeThickness:2.f<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                               strokeDash:@[@4.f, @2.f] // first - length of line, second - length of space | you can use more arguments in array<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                               strokeType:LGDrawerStrokeTypeCenter<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                              shadowColor:[UIColor colorWithWhite:0.f alpha:0.5]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                             shadowOffset:CGPointMake(2.f, 2.f)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;                                               shadowBlur:6.f]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;安装:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;1、支持cocoapods<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;podfile 文件中增加以下一行,<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pod 'LGDrawer',然后执行pod install。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;2、支持Carthage<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;Cartfile 文件中增加以下一行<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;github "Friend-LGA/LGDrawer" ~> 1.0.0
代码评论:
登录后方可评论

  
  • 暂无评论