huanhoo / hhhorizontalpagingview Goto Github PK
View Code? Open in Web Editor NEWHHHorizontalPagingView是一个实现上下滚动时菜单悬停在顶端,并且可以左右滑动切换的视图
License: MIT License
HHHorizontalPagingView是一个实现上下滚动时菜单悬停在顶端,并且可以左右滑动切换的视图
License: MIT License
I have tried to push from tableview didSelectRowAtIndexPath, but can't get navigation controller.
如题 headerview上放一个子控件scrollview 不能滚动这个子控件了
您好,我在tableview里加了一个tableheaderview,但是这个tableheaderview的高度是有问题的,我设置的是50,但是最后显示的整个屏幕的高,这是为什么呢?
HHHorizontalPagingView *pagingView = [[HHHorizontalPagingView alloc] initWithFrame:CGRectMake(0., 0.,width, height)];
通过修改这个控件本身的高度 也无法让高度改变 一直为全屏状态
如果在contentView上的scrollView加一个文字特别长的label,numberOfLines设置为0,scrollView会出现contentSize冲突问题。
设置这句代码,// [headerView.headerImageView setContentMode:UIViewContentModeScaleAspectFill];会导如下headerHeight设置失效,出现BUG
[HHHorizontalPagingView pagingViewWithHeaderView:headerView headerHeight:200.f segmentButtons:buttonArray segmentHeight:60 contentViews:@[tableView, collectionView, scrollView]];
我做了一个类似朋友圈功能,监听到有未读消息,hearderView会多出一块来提示用户,这部分应该怎么实现比较完美.我现在实现出来 高度变化之后,滑动的时候 segmentView和下面的View会有明显分开的感觉
Hello brother,
Long time, hope you are doing well
I got this error, I am trying to catch the issue but with no result, do you have any idea?
The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fcf1e4ab300>, and it is attached to <UICollectionView: 0x7fcf20a27000; frame = (0 0; 375 812); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600000651790>; layer = <CALayer: 0x60000043f960>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 34, 0}> collection view layout: <UICollectionViewFlowLayout: 0x7fcf1e4ab300>.
Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
当下拉刷新还没有结束的时候 我再次下拉 整个头部 上下移动幅度过大 不连贯
如果headview为uiscrollview(轮播图)则uiscrollview(轮播图)手势滑动失效
Hi Again,
Hope you are doing well.
is it possible to reload the segments for example in the initial you set 3 segments and you did some actions you need to reload the segments to be 4.
What do you think?
Thanks
进入之后的操作:
手势滑动到view1 -> 上下滑动 -> 点击segmentView0切换到View0 -> 上下滑动 -> 手势滑动到View1 -> 上下不能滑动
Hi, how can I load UITableViewController instead UITableView?
我两个视图都是collectionView,我第一个collectionView请求数据为空,第二个collectionView数据很多,当我把第二个collectionView向上推,再滑到第一个collectionView就会崩溃,请问怎么解决
Hi dear,
Actually, I am trying to add UIButton in the headerView of HHHorizontalPagingView but the addtarget it doesn't work
I add the UIButton in configureHeaderView
self.createButton = [UIButton newAutoLayoutView];
[self.createButton setBackgroundColor:[UIColor clearColor]];
[self.createButton setTitle:@"Create" forState:UIControlStateNormal];
[self.createButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
self.createButton.titleLabel.font = [UIFont fontWithName:@"Radikal-Medium" size:14.0f];
self.createButton.layer.borderColor = [UIColor whiteColor].CGColor;
self.createButton.layer.borderWidth = 1.0f;
self.createButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
self.createButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
self.createButton.enabled = YES;
[self.createButton addTarget:self action:@selector(createThing:) forControlEvents:UIControlEventTouchUpInside];
and this in the same controller
-(void)createThing:(UIButton *)sender {
NSLog(@"Doing ...");
}
Any hint ?
如要添加下拉刷新,貌似要在横向所有的tableView上添加下拉刷新控件,现在我有这么一个需求,只需要添加一个下拉刷新的控件,因为横向滑动的tableView数据是来自这个下拉刷新后从接口获得的数据,能否添加
请问 怎么做autolayout 的适配问题
Hello again!
when the table view is loaded in the HHorizontalPagingView
, the contentOffset.y
is not from the first cell could you please advice?
Hi, is it possible to stick header/segments and only scrolling the content as tableView..etc. ?
你好,HHHeaderView加入uicollectionview作为它的子控件,放入之后设置横向滑动无法横向滑动的问题,请指教,谢谢
scrollEnable设置为NO时segment无法切换
在- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
方法中判断headerView中的subview,如果是UIButton或者响应输入文字的,则返回该subview本身。
具体的优化见:
https://leavesster.github.io/%E5%B5%8C%E5%A5%97UISCrollview(%E4%BA%8C)/#优化
我现在想加个MJRefresh 在刷新结束时 会出现segment和contentView 会分离一下的情况 不知道是怎么回事
Hello friend,
I got an issue which increases the section height for tableView
and it is considered as an empty space if the user clicks on a segment and scroll down/up immediately.
To reproduce this issue please you can do by following steps:
Dear brother,
We would like to enhance and add nice thing to be used in the header something called StretchyFactor which is help for animation effects for example: change alpha / size / scale / position for any object inside the headerView.
Lets suppose we have UIButton in the headerView and while scrolling down/up we need to change alpha of that UIButton. If the user scrolling to segmentTopSpace so the UIButton alpha will be 0 then if the user scrolling up the alpha will be increase based on StretchyFactor or position.
Hope you got my idea. Am trying to use a sample code in other repository but it doesn't work.
CGFloat ownHeight = CGRectGetHeight(self.bounds);
CGFloat contentHeightDif = (self.maximumContentHeight - self.minimumContentHeight);
CGFloat maxContentViewHeight = ownHeight - self.verticalInset;
CGFloat newStretchFactor = (maxContentViewHeight - self.minimumContentHeight) / contentHeightDif;
谢谢解决了困扰很久的问题 KVO真心搞不懂
Hello brother,
There is a space between segmentView and the contentView in the initial either by click on segmentButton or switching between the pages.
Please look at this image https://d.pr/QV13wj
Any advice?
Regards
我尝试在HHHeaderView里面加载一个按键,UI有出来,只是我怎样弄也弄不到button的action
你好。
我这边碰到个需求,如果可以的话告诉我该如何处理。十分感谢。
需求:下拉的时候在HeaderView上面有MJRfresh的状态效果
因此:在tableview的头部加 MjRefresh
HHContentTableView *tableView = [HHContentTableView contentTableView]; tableView.mj_header= [MJRefreshStateHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshHeader:)];
然后下拉刷新的时候 状态信息 会被segment挡住,可是把mj_header加到headerview上不会触发事件,你有什么好的解决方案吗?
不知道描述是否清楚 ,谢谢先。
先上下滑动 然后左右滑动 会出现contentoffset 出错
Hi brother,
In the scrollViewDidScrollBlock
while you scrolling slowly it returns correct CGfloat but if you are scrolling fast/quick it returns incorrect CGfloat, What do you think ?
Regards
Hi again,
Thanks in advance for your usual support .. am trying to set NSString as property in HHHorizontalPagingView header file like
@property (nonatomic, strong) NSString *someText;
Then I added a method below Setter
- (void)setSomeText:(NSString *)someText { _someText = someText; }
after when I set in the controller like pagingView.someText = @"hi";
it doesn't actually set that value always shown (null).
Thanks again.
我在cell上加了一个searchBar 然后键盘出现的时候 不管在什么位置 都回到最上方 我设置offset 也不管用
我想动态控制头部的高度,这个应该如何做?求教
请支持下:如果加入的view不是scrollview而是普通的view,但是view的第一个视图是scrollview的子类
I tried to use YSLContainerViewController, but it crashed what I want to do is add line indicator to be in the bottom of segments so when the user start scroll the indicator move based on CGoffset could you help me on this please?
the code is:
HHHorizontalPagingView *pagingView = [HHHorizontalPagingView pagingViewWithHeaderView:headerView headerHeight:300.f segmentButtons:buttonArray segmentHeight:60 contentViews:@[self.containerV.view]];
Crash log:
2017-02-11 22:32:54.893 HHHorizontalPagingView[3556:307611] -[UIView contentInset]: unrecognized selector sent to instance 0x7fa8b3100430
2017-02-11 22:32:54.897 HHHorizontalPagingView[3556:307611] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView contentInset]: unrecognized selector sent to instance 0x7fa8b3100430'
*** First throw call stack:
(
0 CoreFoundation 0x00000001093aad4b _exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000108e0c21e objc_exception_throw + 48
2 CoreFoundation 0x000000010941af04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000109330005 forwarding + 1013
4 CoreFoundation 0x00000001093bda08 forwarding_prep_1 + 120
5 HHHorizontalPagingView 0x00000001088122ad -[HHHorizontalPagingView configureContentView] + 461
6 HHHorizontalPagingView 0x00000001088113cc +[HHHorizontalPagingView pagingViewWithHeaderView:headerHeight:segmentButtons:segmentHeight:contentViews:] + 2412
7 HHHorizontalPagingView 0x000000010880fbfa -[ViewController viewDidLoad] + 2186
8 UIKit 0x000000010a083a3d -[UIViewController loadViewIfRequired] + 1258
9 UIKit 0x000000010a083e70 -[UIViewController view] + 27
10 UIKit 0x0000000109f4d4b5 -[UIWindow addRootViewControllerViewIfPossible] + 71
11 UIKit 0x0000000109f4dc06 -[UIWindow _setHidden:forced:] + 293
12 UIKit 0x0000000109f61519 -[UIWindow makeKeyAndVisible] + 42
13 UIKit 0x0000000109ed9f8d -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4818
14 UIKit 0x0000000109ee00ed -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
15 UIKit 0x0000000109edd26d -[UIApplication workspaceDidEndTransaction:] + 188
16 FrontBoardServices 0x000000010e0776cb FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
17 FrontBoardServices 0x000000010e077544 -[FBSSerialQueue _performNext] + 189
18 FrontBoardServices 0x000000010e0778cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
19 CoreFoundation 0x000000010934f761 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
20 CoreFoundation 0x000000010933498c __CFRunLoopDoSources0 + 556
21 CoreFoundation 0x0000000109333e76 __CFRunLoopRun + 918
22 CoreFoundation 0x0000000109333884 CFRunLoopRunSpecific + 420
23 UIKit 0x0000000109edbaea -[UIApplication _run] + 434
24 UIKit 0x0000000109ee1c68 UIApplicationMain + 159
25 HHHorizontalPagingView 0x0000000108819faf main + 111
26 libdyld.dylib 0x000000010c91f68d start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
能否将滚动到相应视图的事件及点击上部button切换视图的事件开放出来,以便进行数据重新请求和刷新
加载完成第一个子视图,向上滑动 然后点击或者滑动加载第二个子视图 第二个子视图的位置还在刚开始的位置 没有随这header的变化而变化 我没解决了 求帮助 @Huanhoo
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.