panghaijiao / hjtabviewcontroller Goto Github PK
View Code? Open in Web Editor NEWA Cool PageViewController
License: MIT License
A Cool PageViewController
License: MIT License
`- (void)viewDidLoad {
[super viewDidLoad];
[self setupsearchView];
[self setUpTableView];
}
(void)setupsearchView{
//1.创建底部view
UIView *underView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, screenW, searchViewH)];
underView.backgroundColor = [UIColor whiteColor];
[self.view addSubview: underView];
//2.创建筛选按钮
UIButton *chooseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.chooseBtn = chooseBtn;
chooseBtn.frame = CGRectMake(screenW - chooseBtnW, 0, chooseBtnW, searchViewH);
[chooseBtn setTitle:@"筛选" forState:UIControlStateNormal];
chooseBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[chooseBtn setImage:[UIImage imageNamed:@"fliter"] forState:UIControlStateNormal];
[chooseBtn addTarget:self action:@selector(chooseBtnClick:) forControlEvents:UIControlEventTouchUpInside];
chooseBtn.backgroundColor = [UIColor whiteColor];
[chooseBtn setTitleColor:WQColor(66, 66, 66) forState:UIControlStateNormal];
[chooseBtn setImageEdgeInsets:UIEdgeInsetsMake(0, -3, 0, 0)];
[underView addSubview:chooseBtn];
UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.cancelBtn = cancelBtn;
cancelBtn.frame = CGRectMake(screenW - chooseBtnW, 0, chooseBtnW, searchViewH);
[cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[cancelBtn setTitleColor:WQColor(136, 136, 136) forState:UIControlStateNormal];
cancelBtn.backgroundColor = [UIColor whiteColor];
cancelBtn.hidden = YES;
[cancelBtn addTarget:self action:@selector(cancelBtnClick:) forControlEvents:UIControlEventTouchDown];
[underView addSubview:cancelBtn];
//2.创建searchbar
KDSearchBar searchBar = [[KDSearchBar alloc]initWithFrame:CGRectMake(5, 5, screenW - chooseBtnW - 10, searchViewH - 52)];
searchBar.placeholder = @"请输入关键词";
searchBar.delegate = self;
searchBar.backgroundImage = [[UIImage alloc]init];
searchBar.backgroundColor = [UIColor whiteColor];
searchBar.contentInset = UIEdgeInsetsMake(2, 2, 2, 2);
UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0, underView.height -0.5, screenW, 0.5)];
line.backgroundColor = WQColor(244, 244, 244);
[underView addSubview:line];
[underView addSubview:searchBar];
}
(void)setUpTableView
{
// self.tableView.frame = CGRectMake(0 , searchViewH, screenW, screenH -kStatusBarAndNavigationBarHeight - kTabbarHeight- searchViewH);
// tableView.delegate = self;
// tableView.dataSource = self;
// tableView.tag = 1000;
// self.tableView.tableFooterView = [UIView new];
self.tableView.separatorColor = BackGroundColor;
self.tableView.backgroundColor = BackGroundColor;
self.tableView.estimatedRowHeight = Cell_h;
// self.tableView = tableView;
// [self.view addSubview:tableView];
UINib *xib =[UINib nibWithNibName:@"KDHomeListCell" bundle:nil] ;
[self.tableView registerNib:xib forCellReuseIdentifier:@"KDHomeListCell"];
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadDetailData)];
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreDetailData)];
[footer setTitle:@"" forState:MJRefreshStateIdle];
// 设置footer
self.tableView.mj_footer = footer;
[self.tableView.mj_header beginRefreshing];
}
`
下载后无法解压,而且 pod 上也搜不到HJTabViewController,git clone 也无法下载
最开始打算在tableView的sectionHeader上做,但是发现这上面做的他会一直悬在中间,而不是跟着tableview上滑到Tab的下面
大神 iPhone X沒有這個問題因為沒有改變navigation bar, 其他iphone 都有這個問題
楼主,我试着改了,感觉牵连的东西有点多啊,
大神,多个子VC的tableview,有一个tableview的contentSize高度不够,划动到其他的tableview,然后向上划动一点距离,再划动回来contentSize高度不够的tableview,那么tableview和tabar之间就会空白一段距离啊。就是少了一个判断tableview的contentSize高度不够的实现。。。bug
经测试 当有至少3个子VC的时候,第一次进入
我新建了一个工程,将HJTabViewBar和JHTabViewController两个文件夹和HeaderTabViewController,TableViewController两个文件拖到新工程,直接显示HeaderTabViewController,报错,提示
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [187.5 nan]'
能帮忙看看是什么错误吗
大神 我是用masonry布局的,布局整体式UIScrollView
vc重写了-(UIScrollView *) tabContentScrollView {
return self.mainScroll;
}
UIScrollView的contentSize是够大的,但是不能上下滑动,请问有可能是什么原因
我使用的不是TableViewController而是UIViewController 加UITableView, Viewcontroller viewDidLoad 方法 只会加载一次, 为什么?
好像一次性会 全部加载完。
谢谢
如题
大神,请问顶部的headerView 那个下拉放大的代码在哪里呀,找了很久没找到,求解
可否在外层(顶部,不是子控制器内)添加下拉刷新控件?
请问大神 如何实现子控制器的刷新在header顶部实现刷新效果
在一个VC中,添加左右2个tableView,设置hj_tabContentScrollView,但是只有一个能上下联动,怎么处理下面的返回值,同步2个呢,谢谢
HeaderTabViewController内容下移了64
当屏幕允许旋转的时候,只要在最后的一个tag旋转,整个的约束都会错乱
你好,大佬,我想问下HeaderTabViewController 子tableview里面加MJRefresh 的 MJRefreshNormalHeader 下拉刷新,这个怎么实现,下拉后,顶部会跟着往下走,没有下拉刷新的效果,这个能实现吗?
[self.tabViewController.view addGestureRecognizer:tabContentScrollView.panGestureRecognizer];
请问下 这句代码是什么意思?能让tableHeader也垂直移动?
经测试 当有至少3个子VC的时候,第一次进入
如果是tabbar控制的自控制器,就会出现上下滑动悬停滑动
如果页面不往上滑动,返回按钮点击无效。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.