Any way to disable TableView scrolling?
I've got a TableView that is sized to fit the data it's holding perfectly, but it's annoying that a user can still drag the contents up and down within the border of the TableView.
Is there a way to disable scrolling on a TableView. I believe the iPhone SDK provides a method for this.
13 Answers
-
Accepted Answer
This is not possible right now but a good feature request.
I've added 2 tickets for 1.4.0 release for this. For iPhone, I have already fixed. Will apply to Android next.
-
scrollable: false
- worked for me, the 'moving' property doesn't seem to do anything.
-
One solution is to put a transparent view over the table. Don't forget to set the touchEnabled:true otherwise the view will forward the events to the tableview. On android you might want to use transparent disabled button as the overlay in some cases.
-
I know this is an OLD question, maybe at that time TableView didn't have that Property, but I've being using
scrollable:false
since Titanium SDK 1.6.x. And it's working as expected!FYI to disable manual scrolling in a ScrollableView just use
touchEnabled : false
. -
@Glenn
does this work for you? because it doesn't for me
-
Doesn't work for me. I believe the moving property specifies whether or not the individual rows within the tableview can be moved up and down within the tableview, not if the tableview itself scrolls.
-
moving: false
Doesn't work. Any other ideas?
-
Try this:
tableview.touchEnabled = false;
-
Neither moving nor touchEnabled work for me… :(
-
I realize this is an old thread, but in Titanium 3.0, disabling scroll on a scrollView is done by setting view.scrollingEnabled = false. This is effective if you want to e.g. make drag and drop on some elements within the scrollView, and don't want it scrolling as you interact.
-
scrollable: false worked for me.
-
try this in your tableview propperties:
moving:false
-
Here's the solution:
For iOS:
touchEnabled = false;
That will allow swipes, though…
For Android: create a view in the same spot (absolute positioning). Give it an opacity of 0. Make sure it's in front of the one you want to disable. If it's still clickable, make sure it's touchEnabled and then listen to the touchstart event. In it, just
return false;