eri*_*oco 7 objective-c nsstring nsattributedstring ios
iOS 7用于NSString::sizeWithAttributes计算NSString给定NSDictionary属性的边界框的大小.但是,我找不到列出可用于其中的所有枚举键的资源NSDictionary.
这些属性可以应用于NSAttributedString对象
但是没有列出它们,它们也没有在NSAttributedString文档中列出.
另外:可用的属性键,这是调整多线标签的最基本的?似乎字体大小和换行模式是最重要的,但没有可用选项的列表,很难说...
eri*_*oco 16
我搜索了20分钟,然后在SO上发布后立即找到答案.叹.
为了将来参考,可用属性列在NSAttributedString - Foundation Reference的底部,在Character Attributes部分中.
上面的链接已经死了.这是新的.
let NSAttachmentAttributeName: String
let NSBackgroundColorAttributeName: String
let NSBaselineOffsetAttributeName: String
let NSCursorAttributeName: String
let NSExpansionAttributeName: String
let NSFontAttributeName: String
let NSForegroundColorAttributeName: String
let NSKernAttributeName: String
let NSLigatureAttributeName: String
let NSLinkAttributeName: String
let NSMarkedClauseSegmentAttributeName: String
let NSObliquenessAttributeName: String
let NSParagraphStyleAttributeName: String
let NSShadowAttributeName: String
let NSSpellingStateAttributeName: String
let NSStrikethroughColorAttributeName: String
let NSStrikethroughStyleAttributeName: String
let NSStrokeColorAttributeName: String
let NSStrokeWidthAttributeName: String
let NSSuperscriptAttributeName: String
let NSTextAlternativesAttributeName: String
let NSTextEffectAttributeName: String
let NSToolTipAttributeName: String
let NSUnderlineColorAttributeName: String
let NSUnderlineStyleAttributeName: String
let NSVerticalGlyphFormAttributeName: String
let NSWritingDirectionAttributeName: String
Run Code Online (Sandbox Code Playgroud)