All Products
Search
Document Center

Footer base class

Last Updated: May 25, 2021

The footer control mainly contains the text link component, the copyright component, and the combination of the text link and copyright.

Sample image

AUTextLinkView - text link

 
  1. @protocol AUTextLinkDelegate <NSObject>
  2. @optional
  3. /* Callback upon text link tapping.
  4. * textLinkView The text link.
  5. * Index Click a subscript, which starts from 0 and corresponds to the params subscript.
  6. * Button The button to click.
  7. */
  8. - (void)textLinkView:(AUTextLinkView *)textLinkView didClickOnIndex:(NSInteger)index atButton:(UIButton *)button;
  9. @end
  10. //
  11. @interface AUTextLinkView : UIView
  12. @property (nonatomic, strong) UIView *containerView; // The container.
  13. @property (nonatomic, weak) id <AUTextLinkDelegate> delegate;
  14. // titles: The text description array.
  15. - (instancetype)initWithFrame:(CGRect)frame params:(NSArray *)params;
  16. @end

AUCopyrightView — copyright

 
  1. @interface AUCopyrightView : UIView
  2. @property (nonatomic, strong) AULabel *copyrightLabel;
  3. //
  4. - (instancetype)initWithFrame:(CGRect)frame string:(NSString *)string;
  5. @end
 
  1. @interface AUPageAnkletModel : NSObject
  2. @property (nonatomic, strong) NSMutableArray *textLinkInfos;
  3. @property (nonatomic, strong) NSString *copyrightInfo;
  4. @end
  5. typedef void(^paramsBlock)(AUPageAnkletModel *model);
  6. @interface AUPageAnkletView : UIView
  7. @property (nonatomic, strong) AUTextLinkView *textLinkView; // The text link.
  8. @property (nonatomic ,strong) AUCopyrightView *copyrightInfoView; // Copyright text.
  9. //
  10. - (instancetype)initWithFrame:(CGRect)frame params:(paramsBlock)params;
  11. @end

Code sample

  • Text link:

       
    1. AUTextLinkView *textLinkBtns = [[AUTextLinkView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(copyRightView1.frame)+40, self.view.width, 50) params:@[@"Bottom link", @"Bottom link", @"Bottom link"]];
    2. textLinkBtns.centerX = self.view.centerX;
    3. [self.view addSubview:textLinkBtns];
  • Copyright:

       
    1. AUCopyrightView *copyRightView1 = [[AUCopyrightView alloc] initWithFrame:CGRectMake(0, 80, self.view.width, 40) string:@"© 2004-2017 Alipay.com. All rights reserved."];
    2. copyRightView1.centerX = self.view.centerX;
    3. [self.view addSubview:copyRightView1];
  • Combination of text link and copyright:

       
    1. AUPageAnkletView *ankletView = [[AUPageAnkletView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(textLinkBtns.frame)+40, self.view.width, 100) params:^(AUPageAnkletModel *model) {
    2. model.textLinkInfos = [[NSMutableArray alloc] initWithArray:@[@"Bottom link", @"Bottom link", @"Bottom link"]];
    3. model.copyrightInfo = @"© 2004-2017 Alipay.com. All rights reserved.";
    4. }];
    5. ankletView.centerX = self.view.centerX;
    6. [self.view addSubview:ankletView];