[TIMOB-7558] Ti API: UI - support setting ScrollView contentWidth/Height using relative dimensions
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 1.8.1 |
Fix Version/s | n/a |
Components | TiAPI |
Labels | n/a |
Reporter | Arthur Evans |
Assignee | Eric Merriman |
Created | 2012-02-06T15:35:13.000+0000 |
Updated | 2018-08-02T17:31:42.000+0000 |
Description
The following feature request came up in the comments for the linked documentation bug.
Ivan:
"contentWidth" should be calculated according to the size of it's parent container/element, which is not scroll view's parent element or something unknown, but it is scroll view itself. So, when setting "contentWidth" to "100%", scroll view's content width should be same as scroll view's width.
This way if someone wants to have scrollable area that has width two times bigger that scroll view's width, he can easily define that with percentage and does not have to calculate it manually. I think that in most cases people will use "auto" as content area's size value, but framework shouldn't limit users to use it on cases that it finds useful.
From other point of view, if fixed values are used, for example, if content's width is 100px and scroll view's width is 50px, percentage can be calculated (200%) without ambiguity.
The only issue here is whether content area can be seen as a child element of scroll view. I think it can, no matter the fact that scroll view's content area does not exist as separate entity and that you actually can't do anything with it (except defining it's size). But, from implementation point of view, what is a scroll view but a view with fixed size that contains another view that can be positioned if it's size is bigger. I would say that content area is not real element, but virtual element that is a child of real scroll view element.
That means, it cannot be created explicitly, it cannot be manipulated directly and it must behave like it does not exists from outside (so, adding elements to scroll view would add elements to content area virtual element and so on).
This could be implemented as more generalized behavior as I explained in TIDOC ticket. If there is a need for more explanation, please let me know. :) Thanks.