Reputation: 2268
I have a UITableView, Is there a way to know the start position of scrolling when table is being scrolled ?
I don't think that I can subclass the UIScrollview of UITableView, right ?
Also, I need to know if there is a method to disable vertical or horizontal scroll in UITableView.
Upvotes: 0
Views: 1167
Reputation: 1203
According to your answer on Niall Mccormack I have observed that you can use
[self.tableView setDelaysContentTouches:NO];
in your tableviewcontroller initialization .
Upvotes: 1
Reputation: 25907
[myScroll setScrollEnabled:NO];
I don't think that I can subclass its UIScrollview, right ?
Yes you can.
Another thing, your question is a bit confusing (at least for me). I am not sure if you are talking about an UIScrollView
, an UITableView
, both, or the "scroll" an UITableView
has.
Upvotes: 0
Reputation: 1372
I don't quite understand your question.
Do you want to
keep the header view visible as the rest of the tableview scrolls?
If so you can make your header view a separate view that sits above your tableview. This would keep it in position as the rest of the table scrolls.
change the origin of your tableview so that it scrolls back to the bottom of your header
You can change the contentInset of your table like so - tableView.contentInset = UIEdgeInsetsMake(-100, 0, 0, 0)];
so that the table view comes to rest at the bottom of your header view.
Also, I need to know if there is a method to disable vertical or horizontal scroll.
With UIScrollViews you can disable all scrolling by setting scrollView.scrollEnabled = NO
or you can control the direction that they scroll by using setContentSize:
and setting the width or height larger than the scrollviews width or height to change whether it scrolls horizontally or vertically.
Upvotes: 0