Appcelerator Titanium - Horizontal scroll in Table Row - titanium

I have a table that I want to have horizontally scrolling rows. When I tried adding a scrollable view to a row, it crashed the app. Is there a particular way to do this? Basically, I'm adding items to each row dynamically and if it overflows I want the older items to scroll off the left, but still be retrievable.

dont add a scroll view just use a regular view and update the width as items are added and scroll the view yourself.
you will have to figure out how scroll the view to the left and right by tracking touch start and touch end.
you might want to find an alternate UI approach though

Why don't use layout property... i mean vertical or horizontal.
var HZview = Ti.UI.createView({
height:'auto',
layout:'horizontal'
)};
VzView.add(TableViewRows);
Now add your rows to this horizontal view and finally your TableView to Vertical View.
var HZview = Ti.UI.createView({
height:'auto',
layout:'vertical'
)};
VzView.add(TableView);

Related

ReactNative ScrollView scroll threshold

I am trying to understand how can I set a threshold for the RN ScrollView.
This is because if you have multiple vertical scrollable View in a horizontal ScrollView then the scrolling of the Views is very difficult.
So i just need something that holds the horizontal scrolling until the finger swipe horizontally for a certain pixel-span.
Has anyone a clue about how to archive this?
You can use the native scroll event in onScrollEnd to get the velocity of the scroll, then only scroll horizontally if it's past a certain amount. On most vertical/horizontal scrolls, most users only scroll in one direction. If you truly want to implement a distance based scroll, you would need to attach a PanResponder to your component and compare the distnaces of the Grant and Release events.

Next and Previous button for looping scrollView

I have a UIScroll view that scrolls between 4 different XIBs. I would like to disable the ability of scrolling by touching the scroll view. There are two buttons at the bottom of my app that I would like to scroll forward and back in a loop. The ViewController is forced to be in landscape orientation, and the scroll view dimensions are 568w x 217h.
Here is an image of the layout: Click Here
What you are tying to do is called "paging", and in my opinion a scroll view in not the best way to do so... here is a great project that looks like what you need:
https://github.com/caesarcat/InfinitePagingView
Hope this helps

Sencha Touch - scroll to last tab on TabBar

There is a view with many tabs in my App. I'd like to set focus on the last one. I can set active tab this.setActiveItem(10), but I'm not able to scroll (programmatically) tabbar to the last item. Content of the 10th tab is shown but 10th item on tabbar is hidden, so user could be confused.
Thanks a lot in advance.
A really good question and many people may find this useful.
So first, instance of tabBar is needed so we can get activeTab of tabPanel. Then we can easily get the offset of tab item. Here, tab item means not the container that holds tab's contents but the tab indicator which can either is placed at top or bottom. So we just need offset of active tab item from tabBar not the container.
this.getMyTabPanel().setActiveItem(6);
var tabBar = this.getMyTabPanel().getTabBar();
var activeTab = tabBar.getActiveTab();
var x= activeTab.element.getX();
var y = activeTab.element.getY();
Next part is, to get instance of tabBar scroller. Once we get this we can pragmatically scroll it do desired position we get in above step.
var scroller = this.getMyTabPanel().getTabBar().getScrollable().getScroller();
scroller.scrollTo(x,y);
Working demo is here
update
You can also enable animation while pragmatically scrolling with -
scroller.scrollTo(x, y, true);

Can't seem to achieve the same effect on my slide menu as Any.Do

I am trying to create the same type of slide-up/pull-up menu (from the bottom) as the Any.do iPhone app, but not having any success.
The issue I am running into is the app was built with storyboards so I am thinking I might have to scratch that idea and use just code.
Any ideas?
There is no need to get rid of your storyboard to recreate this, that's what IBOutlets are for. Any way, it looks like this was made by creating a UIScrollView that takes up the entire screen. Then add a UITableView to the upper section of the scroll view. Mind you in order for this to work, you'll need to disable scrolling on the scroll view in the background.
From there you can programmatically add the other elements to the scroll view to be rendered off screen, since there are only three they can probably just be buttons. And finally, since scrolling is disabled on the background scroll view you can add an image with a UISwipeGestureRecognizer at the bottom of the screen to manually change the scroll view's content offset property.

Horizontally and vertically scrolling table view

I am trying to create a table view that scrolls horizontally and vertically like TeacherKit app.
If I scroll vertically, first row is fixed and if I scroll horizontally, first column is fixed.
Do you guys have any suggestions for that?
This is the screenshot from TeacherKit app.
https://www.dropbox.com/s/65cknxg9vnea8jq/Photo%20Nov%2015%2C%2012%2027%2010%20AM.png
The most common solution is to create a UIScrollView with the same size of your UITableview, and place your table INSIDE the scroll view.
In this situation, the table won't scroll because is fully contained in the scrollView (it has the same size) and you will scroll the scrollView
Let us know how it goes!