daria-kopaliani / dapagescontainer Goto Github PK
View Code? Open in Web Editor NEWA generic views container with a scrollable top bar
License: MIT License
A generic views container with a scrollable top bar
License: MIT License
How can I disable vertical scrolling with this control? (If the control is embedded in a navigation controller)
Hi there!
First of all thank you for your code, it's well done and very useful for the app I'm building.
Anyway one thing is missing which I'm trying to achieve is infinite paging.
In my case I have 5 viewControllers and when you reach the fifth swiping further takes you back to the first, same behaviour when you are on the first and swipe back, you should go to the fifth.
I was thinking about achieve this the UIScrollView's delegates methods:
scrollViewDidEndDragging
scrollViewDidEndScrollingAnimation
scrollViewDidScroll
and the selectedIndex value, but you are using a different method to swipe views and none of my test worked.
Could you please gimme any advice on how to achieve it?
Thanks!
When I use a table view, and in didSelectRowAtIndexPath method, I set a navigation push, but it doesn't work. Please guide to solve it. Thanks!
Hello,
In first you project is very cool! Nice Job!
I have a question. How can i detect the viewWillAppear method for each ViewController ? I need to catch the event.
Your project is not update for the iOS 7 ?
Thank you.
Regards.
Hello daria,
Its very wonderful class, but I think it doesn't work with two UITableViewController , am I right ?
Thanks
UIScrollView holds an (assign) reference to its delegate, not a (weak) reference. When the delegate is deallocated before the scrollview, this can lead to an error:
[SomeType scrollViewDidScroll:]: unrecognized selector sent to instance 0x...
Suggested solution: in DAPagesContainer:
- (void)dealloc { if(self.scrollView) { self.scrollView.delegate = nil; } [self stopObservingContentOffset]; }
I try to add a tableviewcontroller inside. However, it causes the tableview working incorrectly.
Thanks
There is a delay when I tried to quickly swipe through pages, is there any way around this? In a normal scroll view with paging (for instance the home screen on ios), I can very quickly swipe from multiple pages
I believe your logic in DAPageIndicatorView should be:
You're missing the "!"
按钮点击切换页面,KVO监听不到selectIndex的改变,滑动可以监听到,因为按钮点击切换视图的时候,是直接对变量赋值,而没有调用set方法,因此KVO监听不到。
Now I have a very simple configuration.
Only one controller added to DAPagesContainer.
This controller has UIScrollView and UILabel with very long text.
Everything is fine but when I scroll the text up to the end the scrolling (text scrolling) stops and it's not possible to scroll the text neither up or down. Here is small example of my code:
UIViewController *vc = [[UIViewController alloc] init];
vc.title = @"Info";
CGSize vcSize = self.view.frame.size;
UIScrollView *myScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, vcSize.width, vcSize.height)];
UILabel *myLabel = [[UILabel alloc] initWithFrame:myScroll.frame];
myLabel.text = self.video.desc; // very long text
myLabel.lineBreakMode = UILineBreakModeWordWrap;
myLabel.numberOfLines = 0;
[myLabel sizeToFit];
myScroll.contentSize = CGSizeMake(myScroll.contentSize.width, myLabel.frame.size.height + 60);
[myScroll addSubview:myLabel];
[vc.view addSubview:myScroll];
self.pagesContainer.viewControllers = @[vc];
Could you help me? What could be the reason of such a strange behavior?
Hi,
The controllers i'm loading have some autolayout constraints, but they do not appear in the view.
How can I fix this ?
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.