¡@

Home 

2014/10/15 ¤U¤È 10:04:55

iphone Programming Glossary: cashapelayer

how to set cornerRadius for only top-left and top-right corner of a UIView?

http://stackoverflow.com/questions/10167266/how-to-set-cornerradius-for-only-top-left-and-top-right-corner-of-a-uiview

iphone ios cocoa touch uiview cornerradius share improve this question Not directly. You will have to Create a CAShapeLayer Set its path to be a CGPathRef based on view.bounds but with only two rounded corners probably by using UIBezierPath bezierPathWithRoundedRect..

Animating the drawing of a line

http://stackoverflow.com/questions/10603391/animating-the-drawing-of-a-line

the drawing of a line I'm trying to animate the drawing of a line by the following way .h CAShapeLayer rootLayer CAShapeLayer lineLayer CGMutablePathRef path .m path CGPathCreateMutable CGPathMoveToPoint path nil self.frame.size.width.. the drawing of a line I'm trying to animate the drawing of a line by the following way .h CAShapeLayer rootLayer CAShapeLayer lineLayer CGMutablePathRef path .m path CGPathCreateMutable CGPathMoveToPoint path nil self.frame.size.width 2 100 260 CGPathAddLineToPoint.. path self.rootLayer CALayer layer rootLayer.frame self.bounds self.layer addSublayer rootLayer self.lineLayer CAShapeLayer layer lineLayer setPath path lineLayer setFillColor UIColor redColor .CGColor lineLayer setStrokeColor UIColor blueColor..

UIView with a Dashed line

http://stackoverflow.com/questions/12091916/uiview-with-a-dashed-line

pattern count NSInteger count phase CGFloat phase method. This allows you to draw dashed lines . EDIT firstly add CAShapeLayer . Add it as sublayer to your UIView layer . CAShapeLayer has a path property . Now make an object of UIBezierPath . Draw.. This allows you to draw dashed lines . EDIT firstly add CAShapeLayer . Add it as sublayer to your UIView layer . CAShapeLayer has a path property . Now make an object of UIBezierPath . Draw the line using setLineDash . For example UIBezierPath path..

How to crop the image using UIBezierPath?

http://stackoverflow.com/questions/13153223/how-to-crop-the-image-using-uibezierpath

moveToPoint CGPointFromString pointString else aPath addLineToPoint CGPointFromString pointString aPath closePath CAShapeLayer shapeLayer CAShapeLayer layer shapeLayer.path aPath.CGPath view.layer setMask shapeLayer or make it as imageview.layer setMask.. pointString else aPath addLineToPoint CGPointFromString pointString aPath closePath CAShapeLayer shapeLayer CAShapeLayer layer shapeLayer.path aPath.CGPath view.layer setMask shapeLayer or make it as imageview.layer setMask shapeLayer and add..

Drag UIView around Shape Comprised of CGMutablePaths

http://stackoverflow.com/questions/13664615/drag-uiview-around-shape-comprised-of-cgmutablepaths

an ivar to hold the path that the object follows. UIBezierPath path_ It would be nice to see the path so we'll use a CAShapeLayer to display it. We need to add the QuartzCore framework to our target for this to work. CAShapeLayer pathLayer_ We'll need.. so we'll use a CAShapeLayer to display it. We need to add the QuartzCore framework to our target for this to work. CAShapeLayer pathLayer_ We'll need to store the array of points along the path somewhere. Let's use an NSMutableData NSMutableData pathPointsData_.. self initHandlePanGestureRecognizer We create the path displaying layer like this void initPathLayer pathLayer_ CAShapeLayer layer pathLayer_.lineWidth 1 pathLayer_.fillColor nil pathLayer_.strokeColor UIColor blackColor .CGColor pathLayer_.lineCap..

Custom image mask in iOS

http://stackoverflow.com/questions/5880597/custom-image-mask-in-ios

Using CALayer.mask property. Using UIImage.mask property. In first option i create my custom path then assign it to CAShapeLayer.path property then assign CAShapeLayer to CALayer.mask property. At the end i have custom cropped image. In second option.. property. In first option i create my custom path then assign it to CAShapeLayer.path property then assign CAShapeLayer to CALayer.mask property. At the end i have custom cropped image. In second option i use firstly use CGImageMaskCreate method..

iOS: Mask a UIImage using UIBezierPath

http://stackoverflow.com/questions/7071815/ios-mask-a-uiimage-using-uibezierpath

mask in white over the image but doesn't seem to apply it. What do I need to do different to mask the image corners CAShapeLayer maskLayer CAShapeLayer layer UIBezierPath roundedPath UIBezierPath bezierPathWithRoundedRect maskLayer.bounds byRoundingCorners.. image but doesn't seem to apply it. What do I need to do different to mask the image corners CAShapeLayer maskLayer CAShapeLayer layer UIBezierPath roundedPath UIBezierPath bezierPathWithRoundedRect maskLayer.bounds byRoundingCorners UIRectCornerTopLeft..

iPhone Core Animation - Drawing a Circle

http://stackoverflow.com/questions/7991086/iphone-core-animation-drawing-a-circle

Thanks iphone core animation share improve this question What you really should do is to animate the stroke of a CAShapeLayer where the path is a circle. This will be accelerated using Core Animation and is less messy then to draw part of a circle.. width of the stroke you should use lineWidth instead of borderWitdh etc. Set up the shape of the circle int radius 100 CAShapeLayer circle CAShapeLayer layer Make a circular shape circle.path UIBezierPath bezierPathWithRoundedRect CGRectMake 0 0 2.0 radius.. you should use lineWidth instead of borderWitdh etc. Set up the shape of the circle int radius 100 CAShapeLayer circle CAShapeLayer layer Make a circular shape circle.path UIBezierPath bezierPathWithRoundedRect CGRectMake 0 0 2.0 radius 2.0 radius cornerRadius..