处理kbpayvip
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
// 容器(为了便于以 KB_NAV_TOTAL_HEIGHT 作为内容起点)
|
||||
@property (nonatomic, strong) UIView *containerView;
|
||||
// 顶部大图:pay_vip_icon
|
||||
@property (nonatomic, strong) UIImageView *vipImageView;
|
||||
@property (nonatomic, strong) UIImageView *wanImageView;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UILabel *desLabel;
|
||||
//@property (nonatomic, strong) UIImageView *vipImageView;
|
||||
//@property (nonatomic, strong) UIImageView *wanImageView;
|
||||
//@property (nonatomic, strong) UILabel *titleLabel;
|
||||
//@property (nonatomic, strong) UILabel *desLabel;
|
||||
|
||||
// 功能图标四宫格
|
||||
@property (nonatomic, strong) UIImageView *aiImageView;
|
||||
@@ -34,32 +34,6 @@
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
// 1. 顶部大图(略微下移,避开自定义导航栏)
|
||||
[self.containerView addSubview:self.vipImageView];
|
||||
[self.vipImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.left.equalTo(self.containerView).inset(KBFit(27));
|
||||
make.top.equalTo(self.containerView).offset(KB_NAV_TOTAL_HEIGHT + 25);
|
||||
make.height.mas_equalTo((269));
|
||||
}];
|
||||
[self.containerView addSubview:self.wanImageView];
|
||||
[self.wanImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.left.equalTo(self.containerView);
|
||||
make.top.equalTo(self.vipImageView).offset(70);
|
||||
make.bottom.equalTo(self.containerView).offset(-16);
|
||||
}];
|
||||
|
||||
[self.containerView addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.containerView);
|
||||
make.top.equalTo(self.wanImageView).offset(53);
|
||||
}];
|
||||
[self.containerView addSubview:self.desLabel];
|
||||
[self.desLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.containerView);
|
||||
make.top.equalTo(self.titleLabel.mas_bottom).offset(10);
|
||||
}];
|
||||
|
||||
|
||||
// 2. 下方四宫格图标(简单示意)
|
||||
UIView *g1 = [self gridItemWithImageView:self.aiImageView];
|
||||
UIView *g2 = [self gridItemWithImageView:self.keyboardImageView];
|
||||
@@ -72,12 +46,12 @@
|
||||
|
||||
CGFloat spacing = 16;
|
||||
[g1 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.vipImageView);
|
||||
make.top.equalTo(self.desLabel.mas_bottom).offset(18);
|
||||
make.left.equalTo(self.containerView).inset(KBFit(27));
|
||||
make.top.equalTo(self.containerView).offset(KB_NAV_TOTAL_HEIGHT + 25);
|
||||
make.height.mas_equalTo(((KBFit(122))));
|
||||
}];
|
||||
[g2 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.vipImageView);
|
||||
make.right.equalTo(self.containerView).inset(KBFit(27));
|
||||
make.top.equalTo(g1);
|
||||
make.height.equalTo(g1);
|
||||
make.left.equalTo(g1.mas_right).offset(spacing);
|
||||
@@ -90,7 +64,7 @@
|
||||
make.width.equalTo(g1);
|
||||
}];
|
||||
[g4 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.vipImageView);
|
||||
make.right.equalTo(g2);
|
||||
make.top.equalTo(g3);
|
||||
make.left.equalTo(g3.mas_right).offset(spacing);
|
||||
make.height.equalTo(g1);
|
||||
@@ -144,21 +118,7 @@
|
||||
return _containerView;
|
||||
}
|
||||
|
||||
- (UIImageView *)vipImageView {
|
||||
if (!_vipImageView) {
|
||||
_vipImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_vip_icon"]];
|
||||
_vipImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _vipImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)wanImageView {
|
||||
if (!_wanImageView) {
|
||||
_wanImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_wanwhite_icon"]];
|
||||
_wanImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _wanImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)aiImageView {
|
||||
if (!_aiImageView) {
|
||||
@@ -190,23 +150,4 @@
|
||||
}
|
||||
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = @"Become a member of LOVE KEY";
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.font = [KBFont bold:18];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
- (UILabel *)desLabel{
|
||||
if (!_desLabel) {
|
||||
_desLabel = [[UILabel alloc] init];
|
||||
_desLabel.text = @"Unlock all functions";
|
||||
_desLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_desLabel.font = [KBFont medium:14];
|
||||
}
|
||||
return _desLabel;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
15
keyBoard/Class/Pay/V/PagingViewTableHeaderView.h
Normal file
15
keyBoard/Class/Pay/V/PagingViewTableHeaderView.h
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// PagingViewTableHeaderView.h
|
||||
// JXCategoryView
|
||||
//
|
||||
// Created by jiaxin on 2018/8/27.
|
||||
// Copyright © 2018年 jiaxin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface PagingViewTableHeaderView : UIView
|
||||
|
||||
- (void)scrollViewDidScroll:(CGFloat)contentOffsetY;
|
||||
|
||||
@end
|
||||
88
keyBoard/Class/Pay/V/PagingViewTableHeaderView.m
Normal file
88
keyBoard/Class/Pay/V/PagingViewTableHeaderView.m
Normal file
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// PagingViewTableHeaderView.m
|
||||
// JXCategoryView
|
||||
//
|
||||
// Created by jiaxin on 2018/8/27.
|
||||
// Copyright © 2018年 jiaxin. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PagingViewTableHeaderView.h"
|
||||
|
||||
@interface PagingViewTableHeaderView()
|
||||
@property (nonatomic, strong) UIImageView *bgImageView; // 全屏背景图
|
||||
@property (nonatomic, strong) UIImageView *vipImageView;
|
||||
@property (nonatomic, strong) UIImageView *wanImageView;
|
||||
@end
|
||||
|
||||
@implementation PagingViewTableHeaderView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_vipbg_icon"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.bgImageView.clipsToBounds = true;
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.right.equalTo(self);
|
||||
make.height.mas_equalTo(224);
|
||||
}];
|
||||
[self.bgImageView addSubview:self.vipImageView];
|
||||
[self.vipImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.left.equalTo(self.bgImageView).inset(KBFit(27));
|
||||
make.top.equalTo(self.bgImageView).offset(KB_NAV_TOTAL_HEIGHT + 25);
|
||||
make.height.mas_equalTo((269));
|
||||
}];
|
||||
[self.bgImageView addSubview:self.wanImageView];
|
||||
[self.wanImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.left.equalTo(self.bgImageView);
|
||||
make.top.equalTo(self.bgImageView.mas_bottom).offset(-48);
|
||||
make.height.mas_equalTo(391);
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
}
|
||||
|
||||
- (void)scrollViewDidScroll:(CGFloat)contentOffsetY {
|
||||
|
||||
}
|
||||
|
||||
//- (UICollectionViewLayoutAttributes *)preferredLayoutAttributesFittingAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
|
||||
// CGFloat targetWidth = layoutAttributes.size.width > 0 ? layoutAttributes.size.width : KB_SCREEN_WIDTH;
|
||||
// // 先把自身宽度设为目标宽,便于系统计算高度
|
||||
// self.bounds = CGRectMake(0, 0, targetWidth, self.bounds.size.height);
|
||||
// [self setNeedsLayout];
|
||||
// [self layoutIfNeeded];
|
||||
// CGSize fit = [self systemLayoutSizeFittingSize:CGSizeMake(targetWidth, UILayoutFittingCompressedSize.height)
|
||||
// withHorizontalFittingPriority:UILayoutPriorityRequired
|
||||
// verticalFittingPriority:UILayoutPriorityFittingSizeLevel];
|
||||
// CGRect f = layoutAttributes.frame;
|
||||
// f.size.height = ceil(fit.height);
|
||||
// layoutAttributes.frame = f;
|
||||
// return layoutAttributes;
|
||||
//}
|
||||
|
||||
|
||||
- (UIImageView *)vipImageView {
|
||||
if (!_vipImageView) {
|
||||
_vipImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_vip_icon"]];
|
||||
_vipImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _vipImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)wanImageView {
|
||||
if (!_wanImageView) {
|
||||
_wanImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_wanwhite_icon"]];
|
||||
_wanImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _wanImageView;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user