1.0.0"/>

LGDrawer

加入收藏
已有 1 人收藏

2019排球南京总决赛:
介紹:
    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
代碼評論:
登錄后方可評論

  
  • 暫無評論