全部产品

页脚基本类

更新时间:2019-09-26 18:36:39

页脚控件,主要包括文字链接组件,版权组件和文字链接与版权的组合。

效果图

@optional/* 文字链接接点击回调

  • textLinkView 文字链接
  • index 点击下标,下标从 0 开始,对应 params 下标
  • button 点击按钮*/
    • (void)textLinkView:(AUTextLinkView )textLinkView didClickOnIndex:(NSInteger)index atButton:(UIButton )button;

@end

//@interface AUTextLinkView : UIView

@property (nonatomic, strong) UIView *containerView; // 容器@property (nonatomic, weak) id delegate;

// titles: 文字描述数组

  • (instancetype)initWithFrame:(CGRect)frame params:(NSArray *)params;

@end

  1. ## AUCopyrightView -- 版权

@interface AUCopyrightView : UIView

@property (nonatomic, strong) AULabel *copyrightLabel;

//

  • (instancetype)initWithFrame:(CGRect)frame string:(NSString *)string;

@end

  1. ## AUPageAnkletView -- 文字链接与版权组合

@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; // 文字链接@property (nonatomic ,strong) AUCopyrightView copyrightInfoView; // 版权文字

//

  • (instancetype)initWithFrame:(CGRect)frame params:(paramsBlock)params;

@end

  1. ## 代码示例
  2. - 文字链接示例:
  1. AUTextLinkView *textLinkBtns = [[AUTextLinkView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(copyRightView1.frame)+40, self.view.width, 50) params:@[@"底部链接", @"底部链接", @"底部链接"]];
  2. textLinkBtns.centerX = self.view.centerX;
  3. [self.view addSubview:textLinkBtns];
  4. ```
  • 版权示例:

    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];
  • 文字链接 + 版权组合示例:

    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:@[@"底部链接", @"底部链接", @"底部链接"]];
    3. model.copyrightInfo = @"© 2004-2017 Alipay.com. All rights reserved.";
    4. }];
    5. ankletView.centerX = self.view.centerX;
    6. [self.view addSubview:ankletView];