daria-kopaliani / DAPagesContainer

A generic views container with a scrollable top bar
MIT License
517 stars 98 forks source link

Scrolling inside child controller doesn't work #9

Open picasso opened 10 years ago

picasso commented 10 years ago

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?

luuvujose commented 10 years ago

I have the same Problem :(

MikeDaniel18 commented 10 years ago

Getting this too. Have a UITableViewController inside the page containers and after scrolling to the bottom, it freezes. Changing page fixes it, but obviously it shouldn't happen. Is there a fix for this?

Mike

vinhbui commented 9 years ago

Me too

Harris-Fu commented 9 years ago

Set the tableView or scrollView`s bounces to NO, like:

tableView.bounces = NO;

will solve it as a temporary.

But I believe it`s not the best solution.

vinhbui commented 9 years ago

I implement everything from the start, it works, although it's not nice as this one. Wondering what wrong with this?

nileshkotkar commented 8 years ago

Hi guys, Solved the Table View hang Problem. Follow the below steps.

  1. Open DAPagesContainer.m file
  2. find scrollViewDidScroll method.
  3. set the self.scrollView.userInteractionEnabled = YES instead of NO.
krishnateja262 commented 8 years ago

Solved the problem ... while initialising the DAPagesContainer, have self.pagesContainer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth; instead of self.pagesContainer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; i.e just remove the UIViewAutoresizingFlexibleHeight. Let me know if it worked for you.