I need to create a view (a uibutton) of strange shape.
Is this possible with quartz2d? i used this code for buil my UIView
subclass
- (void)drawRect:(CGRect)rect { // Drawing code CGContextRef context = UIGraphicsGetCurrentContext(); CGContextMoveToPoint(context, 100, 100); CGContextAddLineToPoint(context, 150, 150); CGContextAddLineToPoint(context, 100, 200); CGContextAddLineToPoint(context, 50, 150); CGContextAddLineToPoint(context, 100, 100); CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor); CGContextFillPath(context); }
but this is a draw inside a standard U开发者_如何学PythonIView
(rectangular UIView
)
精彩评论