美文网首页
2018-01-30

2018-01-30

作者: 不知道为什么 | 来源:发表于2018-01-30 11:04 被阅读0次

CATextLayer 渲染速度 快鱼 UILabel所以以后争取用 CATextLayer 代替UILabel的代替 争取成熟后造轮子!

记录

-(NSDictionary *)attributes{
    if (!_attributes) {
        CTTextAlignment textAlignment = kCTTextAlignmentCenter;
        CTParagraphStyleSetting alignmentStyleSetting;
        alignmentStyleSetting.spec = kCTParagraphStyleSpecifierAlignment;
        alignmentStyleSetting.valueSize = sizeof(textAlignment);
        alignmentStyleSetting.value = &textAlignment;
        CTParagraphStyleSetting settings[]  = {
           alignmentStyleSetting
        };
        CTParagraphStyleRef style = CTParagraphStyleCreate(settings, 1);
        CTFontRef font = CTFontCreateWithName((CFStringRef)WZ6.fontName, 14, NULL);
        
        _attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                       (__bridge id)font, kCTFontAttributeName,
                       (id)style, kCTParagraphStyleAttributeName, nil];
    }
    return _attributes;
}

相关文章

  • 2018-01-31

    2018-01-30 路易彬彥张娟 2018-01-30 21:48 · 字数 760 · 阅读 4 · 日记本 ...

  • 2018-01-30

    打败灯叔叔的路上经过…… ybrybr 2018-01-30 20:35 · 字数 265 · 阅读 0 · 日记...

  • Python基础学习日志

    2018-01-30 一、函数 1.替换空格、杠号,例: def replaceinfo(oldname): n...

  • 新时代. 朝阳

    2018-01-30 ——岁月如歌诗词选(第二集. 34) 读王跃春《...

  • 天下美王(歌词)

    天下美王 演唱:凤凰 人气:1319134 作词:群星 作曲:群星 上传: 2018-01-30 献花:63 00...

  • 六项精进

    日精进打卡25天 龚璟明 已关注 2018-01-30 22:44 · 字数 214 · 阅读 5 · 日记本 日...

  • 无题

    2018-01-30 舞文弄墨消寒图,企暖盼春数九九。 浮想联翩雪夜梦,文人雅士竞风流。

  • 字数 1213 · 阅读 15 2018-01-30 19:28 秋姑娘轻轻地走了,调皮的冬弟弟却又带着可...

  • 交叉编译boost库

    转载 boost库的交叉编译 2018-01-30 18:32:21 揽星逐月酒微醺 阅读数 374 收藏 更多...

  • 2018-01-30周二祷告词

    2018-01-30为孩子祷告: 蒙主引导!(创31:3) 【经文】【创 31:3】 耶和华对雅各说:“你要回你祖...

网友评论

      本文标题:2018-01-30

      本文链接:https://www.haomeiwen.com/subject/ehgqzxtx.html