Aucune description

FKPullPageBottomView.m 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // FKPullPageBottomView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/8/11.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKPullPageBottomView.h"
  9. @interface FKPullPageBottomView ()
  10. @property (nonatomic, strong) UIImageView *arrowView;
  11. @property (nonatomic, strong) UILabel *titleLabel;
  12. @end
  13. @implementation FKPullPageBottomView
  14. - (instancetype)initWithFrame:(CGRect)frame{
  15. if (self = [super initWithFrame:frame]) {
  16. [self addAllSubviews];
  17. }
  18. return self;
  19. }
  20. - (void)addAllSubviews{
  21. [self addSubview:self.arrowView];
  22. [self addSubview:self.titleLabel];
  23. }
  24. - (void)resetLayoutSubViews{
  25. // 重新布局
  26. self.backgroundColor = UIColorFromRGB(0xffffff);
  27. CGFloat height = CGRectGetHeight(self.bounds);
  28. CGFloat width = CGRectGetWidth(self.bounds);
  29. if (!height || !width) return;
  30. self.titleLabel.center = CGPointMake(width / 2.0f, 25);
  31. self.titleLabel.bounds = CGRectMake(0, 0, self.titleLabel.intrinsicContentSize.width, self.titleLabel.intrinsicContentSize.height);
  32. self.arrowView.center = CGPointMake(CGRectGetMinX(self.titleLabel.frame) - 15, self.titleLabel.center.y);
  33. }
  34. - (void)startRefreshing{
  35. // NSLog(@"startRefreshing 释放查看图文详情");
  36. // self.titleLabel.text = @"释放查看图文详情";
  37. }
  38. - (void)finishRefreshing{
  39. self.titleLabel.text = @"上拉查看图文详情";
  40. }
  41. // 松开可刷新
  42. - (void)canEngageRefreshWithOffsetY:(CGFloat)y{
  43. self.titleLabel.text = @"释放查看图文详情";
  44. }
  45. // 下拉过程
  46. - (void)didDisengageRefreshWithOffsetY:(CGFloat)y{
  47. self.titleLabel.text = @"上拉查看图文详情";
  48. }
  49. #pragma mark - property
  50. - (UIImageView *)arrowView{
  51. if (_arrowView == nil) {
  52. _arrowView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"up_arrow"]];
  53. }
  54. return _arrowView;
  55. }
  56. - (UILabel *)titleLabel{
  57. if (_titleLabel == nil) {
  58. _titleLabel = [[UILabel alloc]init];
  59. _titleLabel.font = [UIFont systemFontOfSize:13];
  60. _titleLabel.textColor = UIColorFromRGB(0x666666);
  61. _titleLabel.text = @"上拉查看图文详情";
  62. }
  63. return _titleLabel;
  64. }
  65. @end