使用CGContextShowTextAtPoint绘制文本但显示的文本是反转的, [英] drawing text using CGContextShowTextAtPoint but text shown is inverted,

查看:74
本文介绍了使用CGContextShowTextAtPoint绘制文本但显示的文本是反转的,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  - (void)drawRect:(CGRect)rect {
    CGContextRef  context = UIGraphicsGetCurrentContext();


    CGContextSelectFont(context, "Arial", 24, kCGEncodingMacRoman);


    CGContextShowTextAtPoint(context, 80, 80, "I am Rahul", 7);





 }

我正在尝试绘制上面显示的文本我是Rahul,但是当我执行代码时,显示了
文本,但是它被反转,为什么会发生我没有得到! !帮助!!

I am trying to draw text as shown above "I am Rahul" but when i execute the code,
text gets shown, but it is inverted, why it is happening I am not getting !! help!!

推荐答案

您可以使用此代码:

CGContextSetTextMatrix(context, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0));

这篇关于使用CGContextShowTextAtPoint绘制文本但显示的文本是反转的,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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