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

  • 相关阅读:
    linux 静态库和动态库(共享库)的制作与使用(注意覆盖问题)转
    手机号码格式正则表达式
    项目去除TFS关联、迁移重部署
    Excel中VLOOKUP函数的用法和注意点
    自定义打赏插件
    分享一个无需注册,无次数限制的Smile聊天机器人接口
    TCP/IP
    Java字典树
    平衡二叉树结构 AVL
    二叉搜索树(二叉排序树)BST
  • 原文地址:https://www.cnblogs.com/hxwj/p/5386884.html
Copyright © 2011-2022 走看看