如何为NSString drawAtPoint设置上下文? [英] how to set a context to NSString drawAtPoint?

查看:44
本文介绍了如何为NSString drawAtPoint设置上下文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在封装许多 [NSString drawAtPoint:withFont:] 函数调用的方法,以便我可以通过一次调用绘制许多字符串,但是如何我告诉方法在哪里画这些线?

I currently working on encapsulation many [NSString drawAtPoint:withFont:] function calls to a method so that I could draw lots of strings by a single call, but how can I tell the method where to draw these strings?

如果我将 CGContextRef 传递给它怎么办,如何设置 CGContextRef 作为当前上下文?

What if I pass a CGContextRef to it, how to set a CGContextRef as current context?

推荐答案

也许您需要这部分代码:

Maybe you need this part of code:

CGContextRef context = UIGraphicsGetCurrentContext();

这篇关于如何为NSString drawAtPoint设置上下文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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