core-animation

Sequence animation using CAAnimationGroup

若如初见. 提交于 2019-12-28 06:22:07
问题 I'm trying to make a sequence of animations, I've found in CAAnimationGroup the right class to achieve that object. In practice I'm adding on a view different subviews and I'd like to animate their entry with a bounce effect, the fact is that I want to see their animations happening right after the previous has finished. I know that I can set the delegate, but I thought that the CAAnimationGroup was the right choice. Later I discovered that the group animation can belong only to one layer,

CALayer: add a border only at one side

筅森魡賤 提交于 2019-12-27 16:41:10
问题 I can add a border to a CALayer in this way: [webView.layer setBorderColor: [[UIColor colorWithRed:0.6 green:0.7 blue:0.2 alpha:1] CGColor]]; [webView.layer setBorderWidth: 2.75]; But is it possible to add a border only at one side? I only need a border at the bottom. Or can I reach this with other properties, e.g. frame, bounds, mask, ...? Thanks for your help! @Control-V UIWebView *webView = [[UIWebView alloc] init]; CALayer *webViewLayer = webView.layer; // now you can do a lot of stuff

CALayer: add a border only at one side

折月煮酒 提交于 2019-12-27 16:40:34
问题 I can add a border to a CALayer in this way: [webView.layer setBorderColor: [[UIColor colorWithRed:0.6 green:0.7 blue:0.2 alpha:1] CGColor]]; [webView.layer setBorderWidth: 2.75]; But is it possible to add a border only at one side? I only need a border at the bottom. Or can I reach this with other properties, e.g. frame, bounds, mask, ...? Thanks for your help! @Control-V UIWebView *webView = [[UIWebView alloc] init]; CALayer *webViewLayer = webView.layer; // now you can do a lot of stuff

Are there any tools or good techniques to find out where the performance bottlenecks are in an iPhone application?

巧了我就是萌 提交于 2019-12-25 18:19:55
问题 I have an app that's half way done. The performance is not really good, and I wonder where the bottlenecks are. Although I can go ahead and start commenting out suspected lines of code, I wonder if there are any tools that would tell me which method cool took how long and what happened next. The stack trace isn't really that helpful. I had a weird idea to convert the stack trace into an GraphViz graph, to see visually the whole picture. I know some guys at IBM did something similar that

Rotating Image multiple times and stopping at desired degree?

ⅰ亾dé卋堺 提交于 2019-12-25 09:47:19
问题 i had tried various method and couldn't figure out how to achieve this.i searched on internet a lot but can't figure out. i have an ImageView (a wheel which spins) , i want to rotate it by 360 degree for 10 times(this is to just give user feel of fast turning wheel) , and then i want to rotate it by particular value say 90 degree( but it might be varying). after this animation finishes i want to bring ImageView back to the initial position. how do i achieve this ? Thanks in advance. 回答1: well

Rotating Image multiple times and stopping at desired degree?

偶尔善良 提交于 2019-12-25 09:44:35
问题 i had tried various method and couldn't figure out how to achieve this.i searched on internet a lot but can't figure out. i have an ImageView (a wheel which spins) , i want to rotate it by 360 degree for 10 times(this is to just give user feel of fast turning wheel) , and then i want to rotate it by particular value say 90 degree( but it might be varying). after this animation finishes i want to bring ImageView back to the initial position. how do i achieve this ? Thanks in advance. 回答1: well

modifying dynamically the duration of CAKeyframeAnimation

孤者浪人 提交于 2019-12-25 06:40:15
问题 In my code I create a CAKeyframeanimation with an infinite repeat count, add it to a specific CALayer. I would like to modify the duration (= the speed) of the animation while animating, without the need of restarting my animation. So when i click on a button, i get a duration that I can set for the animation. I have to remove the animation, create another one, and make it start to where i stopped it. The problem is that I can't seem to restart it from that point without making it loop from

Multiple CALayer masks causing performance issues

孤街醉人 提交于 2019-12-25 06:36:09
问题 I am trying to create a fairly simple animation using 6 CALayer objects, each masked by a path. However, I am running into significant lag spikes when trying to animate them. Here is a video of the animation running. I am able to boost performance by setting shouldRasterize to YES , however it results in pixelation of the text, as you can see from this image: I can correct the pixelation by setting the rasterizationScale to the screen scale, however that brings back the lag spikes that

How to programmatically animate the alignment property of an UIStackView in ios 9

跟風遠走 提交于 2019-12-25 05:13:55
问题 I want to know how can I animate a change in the alignment property of an horizontal UIStackView say from UIStackViewAlignmentCenter to UIStackViewAlignmentTop and vice versa, and I want to visually reflects this change at the same time. EDIT: What I have: This is my hierarchy of views: two buttons named b1 and b2; b1 has an action named "changeAlignmentToTop" and b2 has an action named "changeAlignmentToCenter", which are activated Upon touch Up Inside in the respective button. an UIView

Playing video with many particles animated on top

会有一股神秘感。 提交于 2019-12-25 05:13:35
问题 I am playing a movie using an AVPlayer and animating 500 falling particles on top. I tried to simply add 500 animated CALAyers. I tried several variations on that but performance is always a problem. As soon as I get more then around 100 CALayers, the video gets choppy. What would be the proper way to do this? I thought maybe this should be done using OpenGL, but I never used it and can't find how to have a video played in OpenGL. I can get the background videos as separate frame pngs, but