MDCSnackbarMessageView

@interface MDCSnackbarMessageView : UIView

Class which provides the default implementation of a Snackbar.

  • The color for the background of the Snackbar message view.

    The default color is a dark gray color.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        UIColor *snackbarMessageViewBackgroundColor;
  • The color for the shadow color for the Snackbar message view.

    The default color is @c blackColor.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        UIColor *snackbarMessageViewShadowColor;
  • The color for the message text in the Snackbar message view.

    The default color is @c whiteColor.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIColor *messageTextColor;
  • The font for the message text in the Snackbar message view.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIFont *messageFont;
  • The font for the button text in the Snackbar message view.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIFont *buttonFont;
  • The array of action buttons of the snackbar.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        NSMutableArray<MDCButton *> *actionButtons;
  • The @c accessibilityLabel to apply to the message of the Snackbar.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *accessibilityLabel;
  • The @c accessibilityHint to apply to the message of the Snackbar.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *accessibilityHint;
  • Returns the button title color for a particular control state.

    Default for UIControlStateNormal is MDCRGBAColor(0xFF, 0xFF, 0xFF, (CGFloat)0.6). Default for UIControlStatehighlighted is white.

    Declaration

    Objective-C

    - (nullable UIColor *)buttonTitleColorForState:(UIControlState)state;

    Parameters

    state

    The control state.

    Return Value

    The button title color for the requested state.

  • Sets the button title color for a particular control state.

    Declaration

    Objective-C

    - (void)setButtonTitleColor:(nullable UIColor *)titleColor
                       forState:(UIControlState)state;

    Parameters

    titleColor

    The title color.

    state

    The control state.

  • Indicates whether the Snackbar should automatically update its font when the device’s UIContentSizeCategory is changed.

    This property is modeled after the adjustsFontForContentSizeCategory property in the UIContentSizeCategoryAdjusting protocol added by Apple in iOS 10.0.

    If set to YES, this button will base its message font on MDCFontTextStyleBody2 and its button font on MDCFontTextStyleButton.

    Default value is NO.

    Declaration

    Objective-C

    @property (setter=mdc_setAdjustsFontForContentSizeCategory:, assign, readwrite,
              nonatomic) BOOL mdc_adjustsFontForContentSizeCategory;