我可以通过将 @synthesize UIView 放入视图控制器视图中来获取有效的 CGContext 进行绘图吗
预先感谢您的任何帮助,我正在构建一个多页iPad应用程序,每个页面都有专门的计算,它们都工作得很好,但我想通过一些代表计算的简单线条图来使用户体验更好,我是一旦我获得有效的 CGcontext 工作,就可以轻松地进行绘图,这就是我的问题所在。我已经在每个页面上有一个 webview,现在我希望当用户按下计算按钮时,我的绘图弹出一个 UIView ,我的 UIview 称为绘图视图,它将像我想要的那样弹出打开,但从我读过的所有绘图来看需要在 DrawRect 方法中完成才能使用正确的上下文。我认为我的一些问题是获取上下文的语法。 感谢您的帮助 诺曼
Thank you in advance for any help, I am building a multipage iPad app,and each page has specialized calculations, they all work great, but i would like to make the user experience better with some simple line drawings that represent the calculations, I am comfortable with the drawing once i get a valid CGcontext working, and this is where my problem is. I already have a webview on each page and now I want to have a UIView pop open with my drawing when the user presses the calculate button, My UIview is called drawingView and it will pop open like I want but from what i have read all drawing needs to be done within the DrawRect method in order to use the correct context. I think some of my problem is the syntax for getting the context.
Thanks for any help
Norman
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我必须用老式的方式做我想做的事情,但看起来你应该能够从我想要的任何地方获取 UIView 的当前上下文。通过调用视图并获取其当前上下文。但是当我这样做时,我会收到有关未获取当前上下文的错误。因此,我必须使用传统的 UIViews 类以不同的方式制作我的应用程序,并将它们引入我的页面。
Ok, I had to do what I wanted the old fashioned way, but it just seems like you should be able to get the current context of a UIView from wherever I want. By calling the view and getting it's current context. But when I do ,I get errors about not getting the current context. So, I have to make my app differently using traditional UIViews classes and bringing them into my page.