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就行了~~~~~~~~~~~~~~~~~~

  • 相关阅读:
    随笔-CompletableFuture的使用
    什么是spring,它能够做什么?
    springboot使用mail提示没有该类型的bean
    js中对对象经行判空
    记录一下第一次webSocket通信成功
    RuoYi-Cloud从配置到运行
    Git配置环境变量
    idea反编译失败 /* compiled code */的解决方法
    MacOS终端ssh登陆红旗系统后中文乱码问题解决
    佛教中的“荤腥”(辛腥)指的是什么?
  • 原文地址:https://www.cnblogs.com/hxwj/p/5386884.html
Copyright © 2011-2022 走看看