Can I disable the "sliding-gesture" in the ScrollableView?
I want to use it as a sort of holder of different views and use the sliding animation as a transition, but users shouldn't be able to switch between the views using this specific "sliding-gesture".
thx in advance
4 Answers
-
What's in the child views inside the scrollableview? and it's a view-only objects or you planned to observe any touch events from this child view?
There's always a work-wround, though not always pretty and cumbersome but doable. I'm not sure of the scope of your scrollview though, and the usage of the child views inside your scrollviews. You may able to achieve your goal by manipulating view container size wrapping your scrolling content.
I have an ipad app with buttons as navigation, on click it will trigger different set of article list (categories) by scrolling to certain x point (vertical). The lists are preloaded inside a two ways scrollviews, and hidden lists are blocked by view where i don't want it to show. Within the list, user can scroll horizontally to click on article title to open webview, but not vertically.
I went as far as communicate back to the scrollview child views by storing the views object in an arrays. Like i say, cumbersome but it gets the job done.
-
You could set the touchEnabled property to false but I'm not sure the children of it will be able to receive the touch events after this.
-
This was causing me trouble also, but I've found the answer. If you take a look at the kitchen sink application, you will see it does something similar to what you want in table_view_layout_2.js
Essentially you use a tableview instead of a scrollableview. You then call:
tableView.updateRow(0, newView, {animationStyle:Titanium.UI.iPhone.RowAnimationStyle.LEFT}));
to "scroll" to the other view. When you're creating your tableview, specify:
var tableView = Ti.UI.createTableView({ data: [firstViewToDisplay], scrollable : false, allowsSelection : false, });
It works well for me, and I hope it works for you too!
-
Guy, I have been trying to find a valid solution for this but add following code and it works perfectly fine.
Add it at the point from where you dont want the scrollableview not scrollingYOUR_SCROLLABLEVIEW.setScrollingEnabled(false);