CGRect 在 XCode 中绘制形状(目标 -c)
我只需要帮助来使用 Core Graphics 创建流程图。 从黄色椭圆开始,然后是红色对角线形状,这两个形状通过单个头箭头连接。 (阴影、颜色和箭头..) 如果你能帮助我,我会很高兴 我已经为 ipad 创建了
一个应用程序,它有一个应用程序委托文件组和 10 个其他视图控制器。其中一个视图控制器是“AnimationViewController.xib”以及 .h 和 .m 文件。 现在我将在此视图上绘制一些形状(这是单独的视图)。 我不知道 applicationDidFinishLaunching 方法在这里是否有效。 我在 appdelagate .m 文件中有 applicationDidFinishLaunchingwithOptions 。
启动应用程序后(出现详细视图),我切换到 IfAnimationViewController,但它没有显示任何内容!
如果您能在这个问题上帮助我,我将非常高兴。
非常感谢提前
顺便说一句:我无法提交我所拥有的代码,系统一直要求使用 {} 按钮输入四个空格......这太令人困惑了。
I just need a help to create a flow diagram by using Core Graphics.
Starting with an yellow elips, and follows by a red diagonal Shapes, these two shapes are connected by a single head arrow. (shades, colours and arrows..)
i would be very happy if you could help me
Regards
I have created an application for ipad and it has an app delegate file group and 10 other view controllers.One of those view controllers is "AnimationViewController.xib" and .h and .m files.
Now I am going to draw a few shapes on this view (this is separate view).
I dont know whether the applicationDidFinishLaunching method works here or not.
I have applicationDidFinishLaunchingwithOptions in appdelagate .m file.
After launching the application (comes up detail view), I switch to IfAnimationViewController, and it does not show anything!
I would be very happy if you could help me on this subject.
Many thanks in advance
Btw: I could not submit the codes I have, the system kept asking to put four spaces with using {} button...Its so confusing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Core Data是持久性(即数据库)API,它与绘图无关。
如果您想使用原始石英操作自己绘制东西,您可以:
使用
UIView 的子视图创建一个“新文件”
实现您自己的
drawRect:
方法,它可以绘制您想要的内容(见下文)将自定义视图的实例添加到主视图(或您的窗口),无论是在应用程序启动时,还是通过在
.xib
中将主视图的类设置为自定义视图来添加文件。典型的自定义
drawRect:
实现如下所示:最好的选择是从 查看 iOS 编程指南。
Core Data is the persistency (i.e. database) API, it has nothing to do with drawing.
If you want to draw stuff yourself using primitive quartz operations, you:
Create a "New File" with your subview of
UIView
Implement your own
drawRect:
method, which draws what you want (see below)Add an instance of your custom view to the main view (or your window), either when your app launches, or by setting the class of the main view to your custom view in the
.xib
file.A typical custom
drawRect:
implementation will look something like:Your best bet is to start with some of the sample code referenced in View Programming Guide for iOS.