All Products
Search
Document Center

Result page component

Last Updated: May 25, 2021

AUResultView displays status result views with an image.

Sample images

API description

 
  1. /**
  2. The result view that displays the status.
  3. */
  4. @interface AUResultView : UIView
  5. /**
  6. The image at the top.
  7. */
  8. @property (nonatomic, strong) UIImage *icon;
  9. /**
  10. The middle-sized title in black at the top of the text field.
  11. */
  12. @property (nonatomic, strong) NSString *mainTitleText;
  13. /**
  14. The large-sized title in black in the middle.
  15. */
  16. @property (nonatomic, strong) NSString *midTitleText;
  17. /**
  18. The message in gray at the bottom.
  19. */
  20. @property (nonatomic, strong) NSString *bottomMessage;
  21. /**
  22. Specify whether strikethrough is added to the message at the bottom.
  23. */
  24. @property (nonatomic, assign) BOOL messageThrough;
  25. /**
  26. The expected height of the view. You can obtain the value after initialization is completed.
  27. */
  28. @property (nonatomic, assign, readonly) CGFloat expectHeight;
  29. /**
  30. The ResultView instance method.
  31. @param icon The image.
  32. @param mainTitleText The first title.
  33. @param midTitleText The large-sized title in the middle.
  34. @param bottomMessage The message in gray at the bottom.
  35. @param messageThrough Specify whether strikethrough is added to the message.
  36. @return The AUResultView instance.
  37. */
  38. - (instancetype)initWithIcon:(UIImage *)icon mainTitleText:(NSString *)mainTitleText midTitleText:(NSString *)midTitleText bottomMessage:(NSString *)bottomMessage messageThrough:(BOOL)messageThrough;

Code sample

 
  1. UIImage *image = AUBundleImage(@"alipay-60");
  2. AUResultView *resultView = [[AUResultView alloc] initWithIcon:image
  3. mainTitleText:@"Payment succeeded"
  4. midTitleText:@"998.00"
  5. bottomMessage:@"CNY 1098.00"
  6. messageThrough:YES];
  7. resultView.frame = CGRectMake(marginX, originY, AUCommonUIGetScreenWidth()-2*marginX, resultView.expectHeight);
  8. [self.view addSubview:resultView];