圆弧/圆动画iphone [英] Arc / Circle animation in iphone

查看:150
本文介绍了圆弧/圆动画iphone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将如何动画在iPhone上一个圆圈,使电弧开始于0度和360度?

How would I animate a circle on the iPhone so that the arc starts at "0 degrees" and ends at "360 degrees"?

此先感谢,
周六

Advance Thanks, Sat

推荐答案

您需要读<一个href=\"http://developer.apple.com/documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq%5Fpaths/dq%5Fpaths.html#//apple%5Fref/doc/uid/TP30001066-CH211-DontLinkElementID%5F10\"相对=nofollow>石英2D编程指南对弧部分。 (我假设你正在创建与可可触摸API,而不是一个Web应用程序的应用程序。)你还需要知道如何建立一个自定义动画。您必须创建一个自定义的UIView或CALayer的做图,并创建一个属性(弧度),可以用CAAnimation对象动画。或者,你可以控制使用的NSTimer而不是动画。您pretty多少得有这些类(及其他)的把握退出这个功能。

You need to read the Quartz 2D Programming Guide's section on arcs. (I am assuming you are creating an app with the Cocoa Touch API, not a web app.) You also need to know how to set up a custom animation. You will have to create a custom UIView or CALayer to do the drawing, and create a property (arc degree) that can be animated with a CAAnimation object. Alternatively, you can control the animation using an NSTimer instead. You pretty much have to have a grasp of these classes (and others) to pull this off.

这篇关于圆弧/圆动画iphone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆