代码拉取完成,页面将自动刷新
//
// FileDetailViewController.m
// pkoa
//
// Created by HG on 2022/2/17.
// Copyright © 2022 com.kinggrid. All rights reserved.
//
#import "FileDetailViewController.h"
#import "FileDetailNaviView.h"
@interface FileDetailViewController ()
<
UIScrollViewDelegate,
FileDetailNaviViewDelegate
>
@property (nonatomic , strong) FileDetailNaviView *naviView;//导航分栏
@property (nonatomic , strong) UIScrollView *contentView;
@end
@implementation FileDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initView];
}
- (void)initView
{
self.naviView.frame = CGRectMake(100, HEIGHT_STATUSBAR, MAIN_WIDTH - 150, HEIGHT_NAVIGATION_NEW - HEIGHT_STATUSBAR);
self.contentView.frame = CGRectMake(0, HEIGHT_NAVIGATION_NEW, MAIN_WIDTH, MAIN_HEIGHT - HEIGHT_NAVIGATION_NEW - HEIGHT_TAB_BOTTOM);
self.contentView.contentSize = CGSizeMake(MAIN_WIDTH * 3, MAIN_HEIGHT - HEIGHT_NAVIGATION_NEW - HEIGHT_TAB_BOTTOM);
}
#pragma mark --FileDetailNaviViewDelegate
- (void)clickWithIndex:(NSInteger)index
{
[UIView animateWithDuration:0.2 animations:^{
self.contentView.contentOffset = CGPointMake(MAIN_WIDTH*index, 0);
}];
}
#pragma mark -- UIScrollViewDelegate
#pragma mark -- getter
- (FileDetailNaviView *)naviView
{
if (!_naviView) {
_naviView = [[FileDetailNaviView alloc] init];
_naviView.delegate = self;
[navigationBG addSubview:_naviView];
}
return _naviView;
}
- (UIScrollView *)contentView
{
if (!_contentView) {
_contentView = [[UIScrollView alloc] init];
_contentView.pagingEnabled = YES;
UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, MAIN_WIDTH, MAIN_HEIGHT - HEIGHT_NAVIGATION_NEW - HEIGHT_TAB_BOTTOM)];
testView.backgroundColor = [UIColor orangeColor];
[_contentView addSubview:testView];
UIView *testBView = [[UIView alloc] initWithFrame:CGRectMake(MAIN_WIDTH, 0, MAIN_WIDTH, MAIN_HEIGHT - HEIGHT_NAVIGATION_NEW - HEIGHT_TAB_BOTTOM)];
testBView.backgroundColor = [UIColor systemPinkColor];
[_contentView addSubview:testBView];
UIView *testCView = [[UIView alloc] initWithFrame:CGRectMake(MAIN_WIDTH*2, 0, MAIN_WIDTH, MAIN_HEIGHT - HEIGHT_NAVIGATION_NEW - HEIGHT_TAB_BOTTOM)];
testCView.backgroundColor = [UIColor greenColor];
[_contentView addSubview:testCView];
_contentView.delegate = self;
[self.view addSubview:_contentView];
}
return _contentView;
}
@end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。