Created
May 16, 2014 10:14
-
-
Save ethanbing/158ea8d80144bdbeda67 to your computer and use it in GitHub Desktop.
绘制三角
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//绘制三角 | |
- (void)drawRect:(CGRect)rect | |
{ | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextBeginPath(context); | |
CGContextMoveToPoint (context, CGRectGetMinX(rect), CGRectGetMaxY(rect)); | |
CGContextAddLineToPoint(context, CGRectGetMidX(rect), CGRectGetMinY(rect)); | |
CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); | |
CGContextClosePath(context); | |
CGContextSetFillColorWithColor(context, [[[self class] indicatorColor] CGColor]); | |
CGContextFillPath(context); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment