How to draw a smooth circle with CAShapeLayer and UIBezierPath?

Who knew there are so many ways to draw a circle? TL;DR: If you want to use CAShapeLayer and still get smooth circles, you’ll need to use shouldRasterize and rasterizationScale carefully. Original Here’s your original CAShapeLayer and a diff from the drawRect version. I made a screenshot off my iPad Mini with Retina Display, then … Read more

Auto Layout constraint on CALayer IOS

the whole autoresizing business is view-specific. layers don’t autoresize. what you have to do — in code — is to resize the layer yourself e.g. in a viewController you would do – (void) viewDidLayoutSubviews { [super viewDidLayoutSubviews]; //if you want superclass’s behaviour… // resize your layers based on the view’s new frame self.editViewBorderLayer.frame = self.editView.bounds; … Read more

Inner shadow effect on UIView layer?

For anyone else wondering how to draw an inner shadow using Core Graphics as per Costique’s suggestion, then this is how: (on iOS adjust as needed) In your drawRect: method… CGRect bounds = [self bounds]; CGContextRef context = UIGraphicsGetCurrentContext(); CGFloat radius = 0.5f * CGRectGetHeight(bounds); // Create the “visible” path, which will be the shape … Read more

CALayers didn’t get resized on its UIView’s bounds change. Why?

I used the same approach that Solin used, but there’s a typo in that code. The method should be: – (void)layoutSubviews { [super layoutSubviews]; // resize your layers based on the view’s new bounds mylayer.frame = self.bounds; } For my purposes, I always wanted the sublayer to be the full size of the parent view. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)