[TIMOB-3434] ScrollView: Not able to set default scroll position of content to be viewed.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-05-02T21:47:28.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | default, defaultscrollposition, position, scroll, scrollview, tbs-1.9.0 |
Reporter | TigerMunky |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:45:09.000+0000 |
Updated | 2017-05-02T21:47:28.000+0000 |
Description
Howdy!
After/during creating a scrollView, I would like to be able to set the default starting position of the content viewed.
e.g.
var scrollView = Ti.UI.createScrollView({
});
or
var scrollView = Ti.UI.createScrollView({
}); scrollView.scrollTo(250, 0); <-- works but straight after
this event is fired, another scroll event sets the position to 0,0.
I think the "resetting/default scroll event" occurs when the window
is opened.
// add more content to scrollView
win.add(scrollView);
win.open();
I think the property "defaultScrollPosition: [250, 0]" would be great.
Tested on the KitchenSink example - scroll_views_tabs.js
Thanks in advance!
TM
Problem
A scrollView created by Ti.UI.createScrollView always seems to start at position (0, 0) regardless of what you set contentOffset to. If you set scrollView.contentOffset after the view is already on the screen, then it does have an effect (of casual scrolling...).Reproducible steps:
1.Run the code below.Expected behavior
Customer wants to scroll to a specific point.Sample Code:
Quite surprised this bug is still open... seems like a common thing to be able to do... There is currently no way to set the content offset on creation. The only way is to set the property after the view has been laid out :(
Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.