// // FKPullPageBottomView.m // FirstLink // // Created by jack on 16/8/11. // Copyright © 2016年 FirstLink. All rights reserved. // #import "FKPullPageBottomView.h" @interface FKPullPageBottomView () @property (nonatomic, strong) UIImageView *arrowView; @property (nonatomic, strong) UILabel *titleLabel; @end @implementation FKPullPageBottomView - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self addAllSubviews]; } return self; } - (void)addAllSubviews{ [self addSubview:self.arrowView]; [self addSubview:self.titleLabel]; } - (void)resetLayoutSubViews{ // 重新布局 self.backgroundColor = UIColorFromRGB(0xffffff); CGFloat height = CGRectGetHeight(self.bounds); CGFloat width = CGRectGetWidth(self.bounds); if (!height || !width) return; self.titleLabel.center = CGPointMake(width / 2.0f, 25); self.titleLabel.bounds = CGRectMake(0, 0, self.titleLabel.intrinsicContentSize.width, self.titleLabel.intrinsicContentSize.height); self.arrowView.center = CGPointMake(CGRectGetMinX(self.titleLabel.frame) - 15, self.titleLabel.center.y); } - (void)startRefreshing{ // NSLog(@"startRefreshing 释放查看图文详情"); // self.titleLabel.text = @"释放查看图文详情"; } - (void)finishRefreshing{ self.titleLabel.text = @"上拉查看图文详情"; } // 松开可刷新 - (void)canEngageRefreshWithOffsetY:(CGFloat)y{ self.titleLabel.text = @"释放查看图文详情"; } // 下拉过程 - (void)didDisengageRefreshWithOffsetY:(CGFloat)y{ self.titleLabel.text = @"上拉查看图文详情"; } #pragma mark - property - (UIImageView *)arrowView{ if (_arrowView == nil) { _arrowView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"up_arrow"]]; } return _arrowView; } - (UILabel *)titleLabel{ if (_titleLabel == nil) { _titleLabel = [[UILabel alloc]init]; _titleLabel.font = [UIFont systemFontOfSize:13]; _titleLabel.textColor = UIColorFromRGB(0x666666); _titleLabel.text = @"上拉查看图文详情"; } return _titleLabel; } @end