calayer

How can I know the values in CABasicAnimation keyPath

删除回忆录丶 提交于 2020-12-28 13:13:49
问题 I find some code like this: CABasicAnimation *anim = [CABasicAnimation animation]; anim.keyPath = @"transform.scale"; anim.fromValue = [NSNumber numberWithFloat:1.0]; anim.toValue = [NSNumber numberWithFloat:0]; anim.removedOnCompletion = NO; anim.fillMode = kCAFillModeBoth; anim.delegate = self; [self.view.layer addAnimation:anim forKey:@"scaleOut"]; and anim.keyPath = @"transform.rotation.x"; As far as I know, keyPath is a chained method invoke. "transform.scale" for CALayer is aLayer

How can I know the values in CABasicAnimation keyPath

我只是一个虾纸丫 提交于 2020-12-28 13:11:39
问题 I find some code like this: CABasicAnimation *anim = [CABasicAnimation animation]; anim.keyPath = @"transform.scale"; anim.fromValue = [NSNumber numberWithFloat:1.0]; anim.toValue = [NSNumber numberWithFloat:0]; anim.removedOnCompletion = NO; anim.fillMode = kCAFillModeBoth; anim.delegate = self; [self.view.layer addAnimation:anim forKey:@"scaleOut"]; and anim.keyPath = @"transform.rotation.x"; As far as I know, keyPath is a chained method invoke. "transform.scale" for CALayer is aLayer

Swift - Setting CALayer bounds or frame not working

£可爱£侵袭症+ 提交于 2020-12-13 03:41:45
问题 I'm new to Swift, and I can't seem to figure out one of the most basic things - setting frame and bounds for a CALayer, so I can read them later. I'm trying to see where a box is drawn on a CALayer to determine how close to the center of the layer it is. I would have assumed the CALayer is the same size of the layer/view it's added to with subview, but when I look at the CALayer's frame or bounds it's zero. Same for the superview layer/view. Any help would be much appreciated! Goal: check

Swift - Setting CALayer bounds or frame not working

只愿长相守 提交于 2020-12-13 03:40:30
问题 I'm new to Swift, and I can't seem to figure out one of the most basic things - setting frame and bounds for a CALayer, so I can read them later. I'm trying to see where a box is drawn on a CALayer to determine how close to the center of the layer it is. I would have assumed the CALayer is the same size of the layer/view it's added to with subview, but when I look at the CALayer's frame or bounds it's zero. Same for the superview layer/view. Any help would be much appreciated! Goal: check

CALayer Border is appearing above subview (Z-order related, I think)

限于喜欢 提交于 2020-12-02 05:37:07
问题 I have searched but could not find the reason for this behavior. I have a UIButton whose image I am setting. Here is how the button should appear. Note that this is just a photoshop of the intended button design: Essentially, it is a square custom UIButton with a white border and a little surrounding shadow. In the upper right corner, there is a "X" mark, that will be added programmatically as a subview. Here is the screenshot of the button within the actual app. At this point, I have only

CALayer Border is appearing above subview (Z-order related, I think)

冷暖自知 提交于 2020-12-02 05:36:22
问题 I have searched but could not find the reason for this behavior. I have a UIButton whose image I am setting. Here is how the button should appear. Note that this is just a photoshop of the intended button design: Essentially, it is a square custom UIButton with a white border and a little surrounding shadow. In the upper right corner, there is a "X" mark, that will be added programmatically as a subview. Here is the screenshot of the button within the actual app. At this point, I have only