Class UILabel

All Implemented Interfaces:
CALayerDelegate, NSCoding, NSObjectProtocol, UIAccessibilityIdentification, UIActivityItemsConfigurationProviding, UIAppearanceContainer, UIContentSizeCategoryAdjusting, UICoordinateSpace, UIDynamicItem, UIFocusEnvironment, UIFocusItem, UIFocusItemContainer, UILargeContentViewerItem, UIPasteConfigurationSupporting, UIResponderStandardEditActions, UITraitEnvironment, UIUserActivityRestoring, ObjCProtocol

public class UILabel
extends UIView
implements NSCoding, UIContentSizeCategoryAdjusting
  • Constructor Details

    • UILabel

      public UILabel()
    • UILabel

      protected UILabel​(NSObject.Handle h, long handle)
    • UILabel

      protected UILabel​(NSObject.SkipInit skipInit)
    • UILabel

      public UILabel​(CGRect frame)
    • UILabel

      public UILabel​(NSCoder coder)
  • Method Details

    • getText

      public String getText()
    • setText

      public void setText​(String v)
    • getFont

      public UIFont getFont()
    • setFont

      public void setFont​(UIFont v)
    • getTextColor

      public UIColor getTextColor()
    • setTextColor

      public void setTextColor​(UIColor v)
    • getShadowColor

      public UIColor getShadowColor()
    • setShadowColor

      public void setShadowColor​(UIColor v)
    • getShadowOffset

      public CGSize getShadowOffset()
    • setShadowOffset

      public void setShadowOffset​(CGSize v)
    • getTextAlignment

      public NSTextAlignment getTextAlignment()
    • setTextAlignment

      public void setTextAlignment​(NSTextAlignment v)
    • getLineBreakMode

      public NSLineBreakMode getLineBreakMode()
    • setLineBreakMode

      public void setLineBreakMode​(NSLineBreakMode v)
    • getAttributedText

      public NSAttributedString getAttributedText()
    • setAttributedText

      public void setAttributedText​(NSAttributedString v)
    • getHighlightedTextColor

      public UIColor getHighlightedTextColor()
    • setHighlightedTextColor

      public void setHighlightedTextColor​(UIColor v)
    • isHighlighted

      public boolean isHighlighted()
    • setHighlighted

      public void setHighlighted​(boolean v)
    • isUserInteractionEnabled

      public boolean isUserInteractionEnabled()
      Overrides:
      isUserInteractionEnabled in class UIView
    • setUserInteractionEnabled

      public void setUserInteractionEnabled​(boolean v)
      Overrides:
      setUserInteractionEnabled in class UIView
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled​(boolean v)
    • getNumberOfLines

      public long getNumberOfLines()
    • setNumberOfLines

      public void setNumberOfLines​(long v)
    • adjustsFontSizeToFitWidth

      public boolean adjustsFontSizeToFitWidth()
    • setAdjustsFontSizeToFitWidth

      public void setAdjustsFontSizeToFitWidth​(boolean v)
    • getBaselineAdjustment

      public UIBaselineAdjustment getBaselineAdjustment()
    • setBaselineAdjustment

      public void setBaselineAdjustment​(UIBaselineAdjustment v)
    • getMinimumScaleFactor

      public double getMinimumScaleFactor()
    • setMinimumScaleFactor

      public void setMinimumScaleFactor​(double v)
    • allowsDefaultTighteningForTruncation

      public boolean allowsDefaultTighteningForTruncation()
      Since:
      Available in iOS 9.0 and later.
    • setAllowsDefaultTighteningForTruncation

      public void setAllowsDefaultTighteningForTruncation​(boolean v)
      Since:
      Available in iOS 9.0 and later.
    • getLineBreakStrategy

      public NSLineBreakStrategy getLineBreakStrategy()
    • setLineBreakStrategy

      public void setLineBreakStrategy​(NSLineBreakStrategy v)
    • getPreferredMaxLayoutWidth

      public double getPreferredMaxLayoutWidth()
    • setPreferredMaxLayoutWidth

      public void setPreferredMaxLayoutWidth​(double v)
    • showsExpansionTextWhenTruncated

      public boolean showsExpansionTextWhenTruncated()
    • setShowsExpansionTextWhenTruncated

      public void setShowsExpansionTextWhenTruncated​(boolean v)
    • adjustsLetterSpacingToFitWidth

      @Deprecated public boolean adjustsLetterSpacingToFitWidth()
      Deprecated.
      Deprecated in iOS 7.0.
    • setAdjustsLetterSpacingToFitWidth

      @Deprecated public void setAdjustsLetterSpacingToFitWidth​(boolean v)
      Deprecated.
      Deprecated in iOS 7.0.
    • getLayerClass

      public static Class<? extends CALayer> getLayerClass()
    • adjustsFontForContentSizeCategory

      public boolean adjustsFontForContentSizeCategory()
      Specified by:
      adjustsFontForContentSizeCategory in interface UIContentSizeCategoryAdjusting
    • setAdjustsFontForContentSizeCategory

      public void setAdjustsFontForContentSizeCategory​(boolean v)
      Specified by:
      setAdjustsFontForContentSizeCategory in interface UIContentSizeCategoryAdjusting
    • getTextRect

      public CGRect getTextRect​(CGRect bounds, long numberOfLines)
    • drawText

      public void drawText​(CGRect rect)
    • getUserInterfaceLayoutDirection

      public static UIUserInterfaceLayoutDirection getUserInterfaceLayoutDirection​(UISemanticContentAttribute attribute)
      Since:
      Available in iOS 9.0 and later.
    • getUserInterfaceLayoutDirection

      public static UIUserInterfaceLayoutDirection getUserInterfaceLayoutDirection​(UISemanticContentAttribute semanticContentAttribute, UIUserInterfaceLayoutDirection layoutDirection)
      Since:
      Available in iOS 10.0 and later.