Benötigen Sie einen Tipp mit UIBezierPath. Dreiecksform wie Instagram Sign Up View

Ich versuche, einen Bezierpfad wie das instagram Dreieck im Bild unten zu erstellen, aber ich muss etwas falsch machen. Der Bezier-Pfad wird nicht angezeigt!

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.

}

-(void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];

[self drawTriangle];

}

- (IBAction)closeButton:(UIButton *)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}

- (void)drawTriangle{

UIBezierPath* trianglePath = [UIBezierPath bezierPath];
[trianglePath moveToPoint:CGPointMake(self.signUpButton.center.x, self.signUpButton.frame.origin.y + 30)];
[trianglePath addLineToPoint:CGPointMake(self.signUpButton.center.x - 10, self.imageView.frame.size.height)];
[trianglePath addLineToPoint:CGPointMake(self.signUpButton.center.x + 10, self.imageView.frame.size.height)];

UIColor *fillColor = [UIColor whiteColor];
[fillColor setFill];
UIColor *strokeColor = [UIColor whiteColor];
[strokeColor setStroke];

 [trianglePath fill];
[trianglePath stroke];

[trianglePath closePath];
}

Antworten auf die Frage(4)

Ihre Antwort auf die Frage