All Products
Search
Document Center

Mobile Platform as a Service:Footer base class

Last Updated:Jul 18, 2023

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

AUTextLinkView - text link

    @protocol AUTextLinkDelegate <NSObject>

@optional
/* Callback upon text link tapping.
 * textLinkView     The text link.
 * Index            Click a subscript, which starts from 0 and corresponds to the params subscript.
 * Button           The button to click.
 */
- (void)textLinkView:(AUTextLinkView *)textLinkView didClickOnIndex:(NSInteger)index atButton:(UIButton *)button;

@end

//
@interface AUTextLinkView : UIView

@property (nonatomic, strong) UIView *containerView;    // The container.
@property (nonatomic, weak) id <AUTextLinkDelegate> delegate;

// titles: The text description array.
- (instancetype)initWithFrame:(CGRect)frame params:(NSArray *)params;

@end

AUCopyrightView - copyright

@interface AUCopyrightView : UIView

@property (nonatomic, strong) AULabel *copyrightLabel;

//
- (instancetype)initWithFrame:(CGRect)frame string:(NSString *)string;

@end
@interface AUPageAnkletModel : NSObject

@property (nonatomic, strong) NSMutableArray *textLinkInfos;
@property (nonatomic, strong) NSString *copyrightInfo;

@end

typedef void(^paramsBlock)(AUPageAnkletModel *model);

@interface AUPageAnkletView : UIView

@property (nonatomic, strong) AUTextLinkView *textLinkView;        // The text link.
@property (nonatomic ,strong) AUCopyrightView *copyrightInfoView;  // Copyright text.

//
- (instancetype)initWithFrame:(CGRect)frame params:(paramsBlock)params;

@end

Code sample

  • Text link:

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

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

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