小编DCA*_*ams的帖子

如何删除 UIBezierPath 绘图?

我正在创建一个应用程序,你最终必须签名,我想知道如果签名搞砸了,你将如何清除签名?

编辑:

线路类别:

#import "LinearInterpView.h"

@implementation LinearInterpView
{
    UIBezierPath *path; // (3)
}

- (id)initWithCoder:(NSCoder *)aDecoder // (1)
{
    if (self = [super initWithCoder:aDecoder])
    {
        self.backgroundColor = UIColor.whiteColor;
        [self setMultipleTouchEnabled:NO]; // (2)
        [self setBackgroundColor:[UIColor whiteColor]];
        path = [UIBezierPath bezierPath];
        [path setLineWidth:2.0];
    }
    return self;
}

- (void)drawRect:(CGRect)rect // (5)
{
    [[UIColor blackColor] setStroke];
    [path stroke];
}


- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint p = [touch locationInView:self];
    [path moveToPoint:p];
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event …
Run Code Online (Sandbox Code Playgroud)

drawing objective-c ios uibezierpath

6
推荐指数
2
解决办法
9560
查看次数

标签 统计

drawing ×1

ios ×1

objective-c ×1

uibezierpath ×1