calayer Questions

4

Solved

I'm using the following code to rotate an image, but half the image (down the y-axis) that has been rotated "out of" the page, disappears. How to fix? heading is in radians. CALayer *layer = myUI...
Spritsail asked 19/2, 2011 at 6:1

36

Solved

I’ve been working on an application for a couple of years and received a simple design request: Round the corners on a UIView and add a drop shadow.To do as given below. I want a custom UIView... :...
Rotative asked 21/1, 2011 at 0:58

5

Solved

I have an NSView that contains an NSScrollView containing a CALayer-backed NSView. I've tried all the usual methods of capturing an NSView into an NSImage (using -dataWithPDFInsideRect, NSBitmapIma...
Numeration asked 23/12, 2010 at 5:45

4

I have the following popover in my app: But I want it to look like this edited image (note that even the arrow has a border): Is this possible nowadays? I already tried the following inside ...

7

Solved

Is it possible to make an NSView not clip its subviews that are outside of the bounds? On iOS I would simply set clipsToBounds of my UIView no NO. But NSView doesn't have such a property. I tried e...
Glucoside asked 22/7, 2013 at 16:45

3

A UIView has a CALayer. That's pretty sure. But both seem to provide something that means the same thing. If I'd set clipsToBounds=YES, would this also set the layer's masksToBounds=YES? Why diffe...
Archean asked 24/7, 2009 at 13:44

5

I'm facing trouble switching colours when change mode in iOS 13. The problem is when you see the app in recent apps. UIColors will change but cgColor will not change. It will change effectively w...
Dingus asked 26/2, 2020 at 23:4

3

Solved

I have gone through many threads here and other blogs but not able to solve this issue. I have a added a subview in content view of window. Here is the storyboard-- - I have dragged out outlet of...
Bertha asked 30/9, 2015 at 6:51

7

Solved

How can you make an NSArray full of multiple instances of a CALayer (all with the same frame, contents etc)? Background: CALayer takes a bit of overhead to create, so I would like to create a numbe...
Phreno asked 29/3, 2009 at 16:28

3

Solved

I have the code below tested, but when I give it constraints it becomes a little small circle: override func drawRect(rect: CGRect) { var path = UIBezierPath(ovalInRect: rect) fillColor.setFill()...
Greenling asked 28/2, 2015 at 15:39

3

Solved

I am having some difficulty understanding on how layer masking works. Right now, I have a UIView with UILabels on it. I picture two layers - one with the UIView in the back and one for the labels o...
Trilobate asked 22/7, 2014 at 18:54

12

It's driving me crazy! I am working on a drawing application. Let's say I am working on a UIView called sheet. I am adding some sublayers to this view ([sheet.layer addSublayer:...]) and then I wa...
Lavonnelaw asked 29/4, 2011 at 14:38

6

Solved

I've added a gradient layer: [theView.layer insertSublayer:gradient atIndex:0]; And later on in another method I want to remove this layer. I figured I should get the array of sublayers then get...
Serin asked 22/11, 2010 at 22:5

2

Solved

In my app, I would like to present a transparent UIView (or layer) which acts as a color filter. So, when this view is presented everything below, it is shown in grayscale. Is this possible, and i...
Multipartite asked 3/3, 2016 at 9:48

2

Solved

I am trying to use a CALayer with an image as contents for masking a UIView. For the mask I have complex png image. If I apply the image as a view.layer.mask I get the opposite behaviour of what I ...
Corunna asked 15/2, 2017 at 0:13

3

Solved

I'm making a card game for mac and I'm using a CABasicAnimation to making the card flip around. It's almost working, but it could be a bit better. As it works now, the card flips inwards (to the l...
Pentheam asked 7/4, 2014 at 9:22

9

Solved

What I have: To create this line, I basically have an UIView and I do the following: void setLayerToLineFromAToB(CALayer *layer, CGPoint a, CGPoint b, CGFloat lineWidth) { CGPoint center = { ...
Clarabelle asked 23/8, 2012 at 12:45

4

I have an IOSurface-backed CVPixelBuffer that is getting updated from an outside source at 30fps. I want to render a preview of the image data in an NSView -- what's the best way for me to do that?...
Darrondarrow asked 16/11, 2020 at 19:24

9

Solved

I have a UIView subclass which uses a CAShapeLayer mask on its CALayer. The mask uses a distinct shape, with three rounded corners and a cut out rectangle in the remaining corner. When I resize my...
Computation asked 26/5, 2010 at 7:8

3

Solved

I have a CABasicAnimation that animating a property of a CALayer e.g. bounds.origin. I want to be able to observe the property changing over time, but haven't really found a method that works 100%....
Underpass asked 13/10, 2009 at 0:56

12

Solved

Note: Things have moved on since this question was asked; see here for a good recent overview. Before auto layout, you could change the anchor point of a view's layer without moving the view by ...
Faline asked 17/10, 2012 at 20:47

4

I have a photo app that is using AV Foundation. I have setup a preview layer using AVCaptureVideoPreviewLayer that takes up the top half of the screen. So when the user is trying to take their phot...
Armourer asked 21/2, 2014 at 2:43

4

Solved

I am studying Animation in Core Animation Programming Guide and I get stuck on comprehending pause and resume animation on a layer. The document tells me how to pause and resume animation without ...
Tooth asked 6/1, 2014 at 9:10

2

I would like to create a gradient layer with four given colours. I have a sketch file for the gradients. I have the coordinates for the colour stops. I calculated the normalised coordinates for the...
Pascha asked 9/10, 2017 at 18:30

9

Solved

When I load my view controller I'm getting this error: *** Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CALayer: 0x7fda42c66e30> is a part of cycle in its layer...
Bladdernut asked 22/7, 2015 at 3:0

© 2022 - 2024 — McMap. All rights reserved.