文档

页脚基本类

更新时间:

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

效果图

AUTextLinkView — 文字链接

    @protocol AUTextLinkDelegate <NSObject>

@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 <AUTextLinkDelegate> delegate;

// titles: 文字描述数组
- (instancetype)initWithFrame:(CGRect)frame params:(NSArray *)params;

@end

AUCopyrightView — 版权

@interface AUCopyrightView : UIView

@property (nonatomic, strong) AULabel *copyrightLabel;

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

@end

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

代码示例

  • 文字链接示例:

      AUTextLinkView *textLinkBtns = [[AUTextLinkView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(copyRightView1.frame)+40, self.view.width, 50) params:@[@"底部链接", @"底部链接", @"底部链接"]];
      textLinkBtns.centerX = self.view.centerX;
      [self.view addSubview:textLinkBtns];
  • 版权示例:

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

      AUPageAnkletView *ankletView = [[AUPageAnkletView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(textLinkBtns.frame)+40, self.view.width, 100) params:^(AUPageAnkletModel *model) {
      model.textLinkInfos = [[NSMutableArray alloc] initWithArray:@[@"底部链接", @"底部链接", @"底部链接"]];
      model.copyrightInfo = @"© 2004-2017 Alipay.com. All rights reserved.";
       }];
      ankletView.centerX = self.view.centerX;
      [self.view addSubview:ankletView];
  • 本页导读 (0)
文档反馈