zoukankan      html  css  js  c++  java
  • iOS属性文字NSAttributedString

    它本身是一个Foundation框架的类,

    但如果要使用它主要用到了UIKit框架中的NSAttributedString中的一些常量字符串

    ------------------------------------------------------------------------------------------------------------

    NSFontAttributeName:字体,是一个UIFont对象

    NSParagraphStyleAttributeName:段落,是一个NSParagraphStyle对象

    NSForegroundColorAttributeName:字体颜色,UIColor

    NSBackgroundColorAttributeName:字体背景颜色,UIColor

    NSLigatureAttributeName:连字符,NSNumber(整数),0没有,1默认

    NSKernAttributeName:字间距,NSNumber(整数),默认0

    NSStrikethroughStyleAttributeName:删除线,NSUnderlineStyle

    NSUnderlineStyleAttributeName:下划线,NSUnderlineStyle

    NSStrokeColorAttributeName:边框颜色,UIColor

    NSStrokeWidthAttributeName:边框宽度,NSNumber(整数)

    NSShadowAttributeName:阴影,NSShadow

    NSVerticalGlyphFormAttributeName,横竖排版,NSNumber(整数),0横,1竖

    ------------------------------------------------------------------------------------------------------------

    NSTextEffectAttributeName:设置文本特殊效果,取值为 NSString 对象,目前只有图版印刷效果可用

    NSAttachmentAttributeName:设置文本附件,取值为NSTextAttachment对象,常用于文字图片混排

    NSLinkAttributeName: 设置链接属性,点击后调用浏览器打开指定URL地址

    NSBaselineOffsetAttributeName:设置基线偏移值,取值为 NSNumber (float),正值上偏,负值下偏

    NSUnderlineColorAttributeName:设置下划线颜色

    NSStrikethroughColorAttributeName:设置删除线颜色

    NSObliquenessAttributeName:设置字形倾斜度,取值为 NSNumber (float),正值右倾,负值左倾

    NSExpansionAttributeName: 设置文本横向拉伸属性,取值为 NSNumber (float),正值横向拉伸文本,负值横向压缩文本

    NSWritingDirectionAttributeName:设置文字书写方向,从左向右书写或者从右向左书写

    NSAttributedString的用法很简单,查看API就行了~~~~~~~~~~~~~~~~~~

  • 相关阅读:
    小程序接入第三方ui库(组件库)
    vue仿微信网页版|vue+web端聊天室|仿微信客户端vue版
    Java 开发环境配置
    那么多 Java 版本,如何选择合适的版本
    你不能访问此共享文件夹,因为你组织的安全策略阻止未经身份验证的来宾访问
    JavaScript HTML DOM EventListener addEventListener() 方法
    Vue2.0史上最全入坑教程(上)—— 搭建Vue脚手架(vue-cli)
    使用 Fetch
    CSS3中steps()动画的详解
    MYSQL常用命令
  • 原文地址:https://www.cnblogs.com/hxwj/p/5386884.html
Copyright © 2011-2022 走看看