TCGBToastStyle Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | UIView+Toast.h UIView+Toast.m |
Overview
TCGBToastStyle instances define the look and feel for toast views created via the
makeToast: methods as well for toast views created directly with
toastViewForMessage:title:image:style:.
Warning: TCGBToastStyle offers relatively simple styling options for the default
toast view. If you require a toast view with more complex UI, it probably makes more
sense to create your own custom UIView subclass and present it with the showToast:
methods.
backgroundColor
The background color. Default is [UIColor blackColor] at 80% opacity.
@property (strong, nonatomic) UIColor *backgroundColorDeclared In
UIView+Toast.h
titleColor
The title color. Default is [UIColor whiteColor].
@property (strong, nonatomic) UIColor *titleColorDeclared In
UIView+Toast.h
messageColor
The message color. Default is [UIColor whiteColor].
@property (strong, nonatomic) UIColor *messageColorDeclared In
UIView+Toast.h
maxWidthPercentage
A percentage value from 0.0 to 1.0, representing the maximum width of the toast view relative to it’s superview. Default is 0.8 (80% of the superview’s width).
@property (assign, nonatomic) CGFloat maxWidthPercentageDeclared In
UIView+Toast.h
maxHeightPercentage
A percentage value from 0.0 to 1.0, representing the maximum height of the toast view relative to it’s superview. Default is 0.8 (80% of the superview’s height).
@property (assign, nonatomic) CGFloat maxHeightPercentageDeclared In
UIView+Toast.h
horizontalPadding
The spacing from the horizontal edge of the toast view to the content. When an image is present, this is also used as the padding between the image and the text. Default is 10.0.
@property (assign, nonatomic) CGFloat horizontalPaddingDeclared In
UIView+Toast.h
verticalPadding
The spacing from the vertical edge of the toast view to the content. When a title is present, this is also used as the padding between the title and the message. Default is 10.0.
@property (assign, nonatomic) CGFloat verticalPaddingDeclared In
UIView+Toast.h
cornerRadius
The corner radius. Default is 10.0.
@property (assign, nonatomic) CGFloat cornerRadiusDeclared In
UIView+Toast.h
titleFont
The title font. Default is [UIFont boldSystemFontOfSize:16.0].
@property (strong, nonatomic) UIFont *titleFontDeclared In
UIView+Toast.h
messageFont
The message font. Default is [UIFont systemFontOfSize:16.0].
@property (strong, nonatomic) UIFont *messageFontDeclared In
UIView+Toast.h
titleAlignment
The title text alignment. Default is NSTextAlignmentLeft.
@property (assign, nonatomic) NSTextAlignment titleAlignmentDeclared In
UIView+Toast.h
messageAlignment
The message text alignment. Default is NSTextAlignmentLeft.
@property (assign, nonatomic) NSTextAlignment messageAlignmentDeclared In
UIView+Toast.h
titleNumberOfLines
The maximum number of lines for the title. The default is 0 (no limit).
@property (assign, nonatomic) NSInteger titleNumberOfLinesDeclared In
UIView+Toast.h
messageNumberOfLines
The maximum number of lines for the message. The default is 0 (no limit).
@property (assign, nonatomic) NSInteger messageNumberOfLinesDeclared In
UIView+Toast.h
displayShadow
Enable or disable a shadow on the toast view. Default is NO.
@property (assign, nonatomic) BOOL displayShadowDeclared In
UIView+Toast.h
shadowColor
The shadow color. Default is [UIColor blackColor].
@property (strong, nonatomic) UIColor *shadowColorDeclared In
UIView+Toast.h
shadowOpacity
A value from 0.0 to 1.0, representing the opacity of the shadow. Default is 0.8 (80% opacity).
@property (assign, nonatomic) CGFloat shadowOpacityDeclared In
UIView+Toast.h
shadowRadius
The shadow radius. Default is 6.0.
@property (assign, nonatomic) CGFloat shadowRadiusDeclared In
UIView+Toast.h
shadowOffset
The shadow offset. The default is CGSizeMake(4.0, 4.0).
@property (assign, nonatomic) CGSize shadowOffsetDeclared In
UIView+Toast.h
imageSize
The image size. The default is CGSizeMake(80.0, 80.0).
@property (assign, nonatomic) CGSize imageSizeDeclared In
UIView+Toast.h
activitySize
The size of the toast activity view when makeToastActivity: is called.
Default is CGSizeMake(100.0, 100.0).
@property (assign, nonatomic) CGSize activitySizeDeclared In
UIView+Toast.h
fadeDuration
The fade in/out animation duration. Default is 0.2.
@property (assign, nonatomic) NSTimeInterval fadeDurationDeclared In
UIView+Toast.h
– initWithDefaultStyle
Creates a new instance of TCGBToastStyle with all the default values set.
- (instancetype)initWithDefaultStyleDeclared In
UIView+Toast.h
– init
Only the designated initializer should be used to create
an instance of TCGBToastStyle.
- (instancetype)initDiscussion
Warning: Only the designated initializer should be used to create
an instance of TCGBToastStyle.
Declared In
UIView+Toast.h