iOS Lover iOS Lover - 6 months ago 106
Objective-C Question

Disable only vertical scrolling of UIScrollView inside UITableViewCell

I have scrollView inside my custom UITableViewCell. Now I want to disable the only vertical scrolling of scrollView inside the Custom UITableViewCell, So I can detect the vertical scrolling of its parentView UITableView during its vertical scrolling.

Note: However custom cell should have horizontal scrolling every time.

Thanks in Advance.

Answer

Either you can try this:

self.tableView.alwaysBounceVertical = NO;

Or you can try set the contentSize, like:

myScroll.contentSize = CGSizeMake(myScroll.contentSize.width,myScroll.frame.size.height);

I hope this can help you.

Comments