Result page component

更新时间:
复制 MD 格式

AUResultView displays status views that contain images.

Screenshots

API reference

/**
 Displays a result view for a status.
 */
@interface AUResultView : UIView

/**
 The image at the top.
 */
@property (nonatomic, strong) UIImage *icon;

/**
 The medium-sized black title at the top of the text area.
 */
@property (nonatomic, strong) NSString *mainTitleText;

/**
 The large-sized black title in the middle.
 */
@property (nonatomic, strong) NSString *midTitleText;

/**
 The gray message at the bottom.
 */
@property (nonatomic, strong) NSString *bottomMessage;

/**
 Specifies whether to add a strikethrough to the bottom message.
 */
@property (nonatomic, assign) BOOL messageThrough;

/**
 The expected height of the view. This value is available after initialization.
 */
@property (nonatomic, assign, readonly) CGFloat expectHeight;

/**
 Instantiates a ResultView.

 @param icon The image.
 @param mainTitleText The first title.
 @param midTitleText The large title in the middle.
 @param bottomMessage The gray message at the bottom.
 @param messageThrough Specifies whether to add a strikethrough.
 @return An AUResultView instance.
 */
- (instancetype)initWithIcon:(UIImage *)icon mainTitleText:(NSString *)mainTitleText midTitleText:(NSString *)midTitleText bottomMessage:(NSString *)bottomMessage messageThrough:(BOOL)messageThrough;

Code example

UIImage *image = AUBundleImage(@"alipay-60");
AUResultView *resultView = [[AUResultView alloc] initWithIcon:image
                                                mainTitleText:@"Payment successful"
                                                 midTitleText:@"998.00"
                                                bottomMessage:@"USD 1098.00"
                                               messageThrough:YES];
resultView.frame = CGRectMake(marginX, originY, AUCommonUIGetScreenWidth()-2*marginX, resultView.expectHeight);
[self.view addSubview:resultView];