core text 在iPad中怎样设置位置 core text 在iPad中怎样设置位置?我在测试中发现,y坐标是反着的⋯⋯哎⋯⋯ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 大家有什么core text的例子吗?简单一点的最好stackoverflow 的就不要了,我几乎都看完了 http://www.cocoachina.com/bbs/read.php?tid-14889.html看看是不是这个 这个不好,一点都不好,都不能运行~~我贴一段能运行的:CGContextRef context = UIGraphicsGetCurrentContext(); float viewHeight = self.bounds.size.height; CGContextTranslateCTM(context, 0, viewHeight); CGContextScaleCTM(context, 1.0, -1.0); CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, 1.0)); CTFontRef font = CTFontCreateWithName(CFSTR("Times"), 48, NULL); CFStringRef keys[] = { kCTFontAttributeName }; CFTypeRef values[] = { font }; CFDictionaryRef attr = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFAttributedStringRef attrString = CFAttributedStringCreate(NULL, CFSTR("Hello, World!"), attr); CFRelease(attr); CGMutablePathRef path = CGPathCreateMutable(); CGRect bounds = CGRectMake(0,0,200,200); CGPathAddRect(path, NULL, bounds); /* draw the text */ CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attrString); CTFrameRef frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, NULL); CFRelease(framesetter); CFRelease(path); CTFrameDraw(frame, context); XCode中如何查看和设置GCC的编译选项 IPad游戏支付接口问题 ios 按钮选中后背景图片变化的问题 求助3个功能的实现(求越狱开发高手帮忙) 怎么用电脑登录苹果手机里面的APP 国内开发者可以向美国苹果商店上投产品吗?需要突破什么障碍吗? 从服务器接收返回信息 请问大神这个怎么解决啊 OCR SDK哪里可以获取到?怎么用 关于collectionviewFlowLayout的一点疑问 给童鞋们散散分 数据库有问题了!
简单一点的最好
stackoverflow 的就不要了,我几乎都看完了
我贴一段能运行的:CGContextRef context = UIGraphicsGetCurrentContext();
float viewHeight = self.bounds.size.height;
CGContextTranslateCTM(context, 0, viewHeight);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, 1.0));
CTFontRef font = CTFontCreateWithName(CFSTR("Times"), 48, NULL);
CFStringRef keys[] = { kCTFontAttributeName };
CFTypeRef values[] = { font };
CFDictionaryRef attr = CFDictionaryCreate(NULL,
(const void **)&keys,
(const void **)&values,
sizeof(keys) / sizeof(keys[0]),
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
CFAttributedStringRef attrString = CFAttributedStringCreate(NULL, CFSTR("Hello, World!"), attr);
CFRelease(attr);
CGMutablePathRef path = CGPathCreateMutable();
CGRect bounds = CGRectMake(0,0,200,200);
CGPathAddRect(path, NULL, bounds);
/* draw the text */
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attrString);
CTFrameRef frame = CTFramesetterCreateFrame(framesetter,
CFRangeMake(0, 0), path, NULL);
CFRelease(framesetter);
CFRelease(path);
CTFrameDraw(frame, context);