全部产品

页脚基本类

更新时间:2021-01-15 17:47:03

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

效果图

AUTextLinkView — 文字链接

  1. @protocol AUTextLinkDelegate <NSObject>
  2. @optional
  3. /* 文字链接点击回调
  4. * textLinkView 文字链接
  5. * index 点击下标,下标从 0 开始,对应 params 下标
  6. * button 点击按钮
  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; // 容器
  13. @property (nonatomic, weak) id <AUTextLinkDelegate> delegate;
  14. // titles: 文字描述数组
  15. - (instancetype)initWithFrame:(CGRect)frame params:(NSArray *)params;
  16. @end

AUCopyrightView — 版权

  1. @interface AUCopyrightView : UIView
  2. @property (nonatomic, strong) AULabel *copyrightLabel;
  3. //
  4. - (instancetype)initWithFrame:(CGRect)frame string:(NSString *)string;
  5. @end

AUPageAnkletView — 文字链接与版权组合

  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; // 文字链接
  8. @property (nonatomic ,strong) AUCopyrightView *copyrightInfoView; // 版权文字
  9. //
  10. - (instancetype)initWithFrame:(CGRect)frame params:(paramsBlock)params;
  11. @end

代码示例

  • 文字链接示例:

    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];
  • 版权示例:

    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];