[TIMOB-19394] Parity: Ti.UI.View.add should support array of views on Windows as iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-11-12T04:40:31.000+0000 |
Affected Version/s | Release 4.1.0 |
Fix Version/s | Release 5.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Gary Mathews |
Created | 2015-08-23T08:47:56.000+0000 |
Updated | 2015-11-17T01:15:03.000+0000 |
Description
On iOS
Ti.UI.View.add()
accepts an array of views:
https://github.com/appcelerator/titanium_mobile/blob/0357b4796abf0032485018fac42614a94f826c9b/iphone/Classes/TiViewProxy.m#L148
On Android it does not:
https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java#L159
This is a very useful feature and looking at the iOS code simple to implement for Android and Windows as well.
Related question on Q&A:
https://community.appcelerator.com/topic/3075/unable-to-add-array-of-views-to-parent-view-on-android
It's not too hard to do this for Windows, but I should note that the iOS version also supports using an object to specify the view and the position to insert it. Both the array and the single/array of objects with a "view" and "position" key are undocumented. Do we fix the docs? Do we make all the platforms behave exactly like iOS? Do we only support the possible array of views, but not the objects specifying both a view and position for each view? cc [~cng][~hpham][~bhatfield][~rblalock][~ingo]
Here's the PR for adding support for a single or array of views to Windows SDK: https://github.com/appcelerator/titanium_mobile_windows/pull/426 Doesn't add support for a single/array of objects with "view" and "position" keys.
[~penrique], fyi about this. Hopefully your native auto layout for iOS will continue to support this. Considering that we are having an overhaul on UI for iOS, we will keep iOS as it is for now and keep the "view" and "position" key undocumented. [~msamah], [~hpham], are we able to support this on Android?
Reopening ticket: OS: Microsoft Windows 10 Pro 10.0.10240 Appc core: 5.1.0-43 Appc NPM: 4.2.1 Ti SDK: 5.1.0.v20151104190037 Using the code below the app crashes on launch on Windows, the code runs as expected on iOS
PR: https://github.com/appcelerator/titanium_mobile_windows/pull/473 5_1_X: https://github.com/appcelerator/titanium_mobile_windows/pull/474
Verified using: OS: Microsoft Windows 10 Pro Appc core: 5.1.0-58 Appc NPM: 4.2.1 Ti SDK : 5.1.0.v20151116142031, 5.2.0.v20151116164440 Appc Studio: 4.4.0.201511130407 Using the code below the labels are now added to the window as expected
Closing ticket