UIView with a Dashed line

Check UIBezierPath setLineDash:count:phase: method: – (void)setLineDash:(const CGFloat *)pattern count:(NSInteger)count phase:(CGFloat)phase` method. This allows you to draw dashed lines. First add a CAShapeLayer. Add it as sublayer to your UIView. It has a path property. Now make an object of UIBezierPath. Draw the line using setLineDash. For example: UIBezierPath *path = [UIBezierPath bezierPath]; //draw a line … Read more

After rotating a CALayer using CABasicAnimation the layer jumps back to it’s unrotated position

Have you set the removedOnCompletion property of the rotation animation to NO, e.g., rota.removedOnCompletion = NO; That should leave the presentation layer where it was when the animation finished. The default is YES, which will snap back to the model value, i.e., the behavior you describe. The fillMode should also be set, i.e., rota.fillMode = … Read more

Subview appears underneath superviews layer.border?

According to the Apple specification: It is composited above the receiver’s contents and sublayers. So, the border will always be above of all your subviews, even if you bring your subview to the front and so on. So I make a background view to fake the border. E.g.: UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(100, 100, … Read more

UIImage from CALayer in iOS

Sounds like you want to render your layer into a UIImage. In that case, the method below should do the trick. Just add this to your view or controller class, or create a category on CALayer. Obj-C – (UIImage *)imageFromLayer:(CALayer *)layer { UIGraphicsBeginImageContextWithOptions(layer.frame.size, NO, 0); [layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return outputImage; } … Read more

How to do transforms on a CALayer?

Basics There are a number of different transforms you can do on a layer, but the basic ones are translate (move) scale rotate To do transforms on a CALayer, you set the layer’s transform property to a CATransform3D type. For example, to translate a layer, you would do something like this: myLayer.transform = CATransform3DMakeTranslation(20, 30, … Read more

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