//行間距 84行
@property (NS_NONATOMIC_IOSONLY) CGFloat lineSpacing;
1: 父類
繼承于: NSParagraphStyle
2: 屬性
//這一段的底部和下一段的頂部之間的距離(或下一段的"頁眉", 如果有的話); 類似于頁腳;
@property (NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacing;
//段落的位置樣式
@property (NS_NONATOMIC_IOSONLY) NSTextAlignment alignment;
typedef NS_ENUM(NSInteger, NSTextAlignment) {
NSTextAlignmentLeft = 0,//居左
NSTextAlignmentCenter = 1,//居中
NSTextAlignmentRight = 2,//居右
NSTextAlignmentJustified = 3,//兩端對(duì)齊
NSTextAlignmentNatural = 4 //默認(rèn)對(duì)齊方式
};
//首行縮進(jìn)距離
@property (NS_NONATOMIC_IOSONLY) CGFloat firstLineHeadIndent;
//左側(cè)縮進(jìn)距離
@property (NS_NONATOMIC_IOSONLY) CGFloat headIndent;
//
@property (NS_NONATOMIC_IOSONLY) CGFloat tailIndent;
//換行模式
@property (NS_NONATOMIC_IOSONLY) NSLineBreakMode lineBreakMode;
typedef NS_ENUM(NSInteger, NSLineBreakMode) {
NSLineBreakByWordWrapping = 0, //按照單詞來換行
NSLineBreakByCharWrapping, //按照字符來換行
NSLineBreakByClipping, //按照單詞來換行, 直接剪切(不是按照字符切割, 可能會(huì)切割半個(gè)字符)
NSLineBreakByTruncatingHead, //單行: 開頭是省略號(hào); 多行: 最后一行的開頭是省略號(hào)
NSLineBreakByTruncatingTail, //單行: 結(jié)尾是省略號(hào); 多行: 最后一行的結(jié)尾是省略號(hào)
NSLineBreakByTruncatingMiddle //單行:中間是省略號(hào); 多行: 最后一行的中間是省略號(hào)
} NS_ENUM_AVAILABLE(10_0, 6_0);
//最小行高
@property (NS_NONATOMIC_IOSONLY) CGFloat minimumLineHeight;
//最大行高
@property (NS_NONATOMIC_IOSONLY) CGFloat maximumLineHeight;
//書寫方向
@property (NS_NONATOMIC_IOSONLY) NSWritingDirection baseWritingDirection;
typedef NS_ENUM(NSInteger, NSWritingDirection) {
NSWritingDirectionNatural = -1, //默認(rèn)書寫方向(和從左向右一樣)
NSWritingDirectionLeftToRight = 0, //從左向右
NSWritingDirectionRightToLeft = 1 //從右向左
} NS_ENUM_AVAILABLE_IOS(6_0);
@property (NS_NONATOMIC_IOSONLY) CGFloat lineHeightMultiple;
//前一段的底部(或前一段的"頁腳", 如果有的話)和這段頂部之間的距離; 類似于頁眉;
@property (NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacingBefore;
@property (NS_NONATOMIC_IOSONLY) float hyphenationFactor;
@property (null_resettable, copy, NS_NONATOMIC_IOSONLY) NSArray<NSTextTab *> *tabStops;
@property (NS_NONATOMIC_IOSONLY) CGFloat defaultTabInterval;
@property (NS_NONATOMIC_IOSONLY) BOOL allowsDefaultTighteningForTruncation;
3:方法
//
- (void)addTabStop:(NSTextTab *)anObject;
- (void)removeTabStop:(NSTextTab *)anObject;
- (void)setParagraphStyle:(NSParagraphStyle *)obj;
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者