你好,歡迎來到IOS教程網

 Ios教程網 >> IOS訊息 >> 關於IOS >> iOS UILabel 詳解(不定期更新ing)

iOS UILabel 詳解(不定期更新ing)

編輯:關於IOS

var text: String!

@property(nonatomic, copy) NSString *text

//label 文字

var attributedText: NSAttributedString!

@property(nonatomic, copy) NSAttributedString *attributedText

//label attributedText (富文本 可以設置段落格式 字體顏色 多種屬性)

var font: UIFont!

@property(nonatomic, retain) UIFont *font

//字體設置

var textColor: UIColor!

@property(nonatomic, retain) UIColor *textColor

//字體顏色設置

var textAlignment: NSTextAlignment

@property(nonatomic) NSTextAlignment textAlignment

//段落對齊格式

var lineBreakMode: NSLineBreakMode

@property(nonatomic) NSLineBreakMode lineBreakMode

//段落換行模式

var enabled: Bool

@property(nonatomic, getter=isEnabled) BOOL enabled

//只是決定了Label的繪制方式,將它設置
為NO將會使文本變暗,表示它沒有激活,這時向它設置顏色值是無效的

var adjustsFontSizeToFitWidth: Bool

@property(nonatomic) BOOL adjustsFontSizeToFitWidth

//是否自適應高度

@property(nonatomic) BOOL adjustsLetterSpacingToFitWidth //ios 7.0 放棄

//

var baselineAdjustment: UIBaselineAdjustment

@property(nonatomic) UIBaselineAdjustment baselineAdjustment

//

var minimumScaleFactor: CGFloat

@property(nonatomic) CGFloat minimumScaleFactor

//

@property(nonatomic) CGFloat minimumFontSize //6.0 棄用

//

var numberOfLines: Int

@property(nonatomic) NSInteger numberOfLines

//段落行數 為0時 可設置自適應高度

var highlightedTextColor: UIColor!

@property(nonatomic, retain) UIColor *highlightedTextColor

//高亮文字顏色

var highlighted: Bool

@property(nonatomic, getter=isHighlighted) BOOL highlighted

//是否高亮

var shadowColor: UIColor!

@property(nonatomic, retain) UIColor *shadowColor

//陰影顏色

var shadowOffset: CGSize

@property(nonatomic) CGSize shadowOffset

//陰影大小

func textRectForBounds(_ bounds: CGRect,limitedToNumberOfLines numberOfLines: Int) -> CGRect

- (CGRect)textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(NSInteger)numberOfLines

//

func drawTextInRect(_ rect: CGRect)

- (void)drawTextInRect:(CGRect)rect

//

var userInteractionEnabled: Bool

@property(nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled

//

var preferredMaxLayoutWidth: CGFloat

@property(nonatomic) CGFloat preferredMaxLayoutWidth

//

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved