Uibezierpath and Cashapelayer with wanton drawing

Source: Internet
Author: User
Tags border color

First, CashapelayerCashapelayer is a subclass of Calayer, but more flexible than calayer, you can draw a variety of shapes using Cashapelayer to draw a rectangle let layer = CAShapeLayer() layer.frame = CGRectMake(110, 100, 150, 100) layer.backgroundColor = UIColor.blackColor().CGColor view.layer.addSublayer(layer)   CAShapeLayer 画图时的动画改变Strokeend, Strokestart, and LineWidth are three properties that control the animation effect when the dash is crossed.  Two Uibezierpath Cashapelayer has a magical attribute that path uses this property in conjunction with the Uibezierpath class to achieve the super-divine effect.
  2.1. Two important color properties of Cashapelayer fillcolor: fill Color of Layer layer.fillColor = UIColor.clearColor(). CGColor strokecolor:layer Border Color layer.strokeColor = UIColor.blackColor().CGColor   2.2、CAShapeLayer 和 Uibezierpath Mating Line let path = UIBezierPath(arcCenter: view.center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise:  true ) let layer = CAShapeLayer() layer.path = path.CGPath layer.fillColor = UIColor.clearColor().CGColor layer.strokeColor = UIColor.blackColor().CGColor

Uibezierpath and Cashapelayer with wanton drawing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.