GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-07-09T23:25:15.000+0000 |
Affected Version/s | Release 3.2.2 |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | android, parity, scrollableview |
Reporter | Himanshu Justa |
Assignee | Joshua Quick |
Created | 2014-04-22T09:41:41.000+0000 |
Updated | 2018-07-09T23:25:19.000+0000 |
I created a parent view as ScrollableView and gave its width and height as Ti.UI.FILL.
Then I created child view giving its width and height as 80%.
In iOS simulator I get the expected result, but in android device child view takes the whole view
In the attachment I have added my code and also the screenshot from iOS simulator and android device.
[~himanshujusta] It appears you copied .tss file as .xml file as well. I can only see .tss and .js files attached. Please provide the xml file to complete the test case. index.js
index.tss
Following is the xml code.
Moving this ticket to engineering as I can reproduce this issue with Android platform. Works as expected on iOS platform.
Hi, Can someone let me know whats the status the issue. Im not able to go forward with my work because of this issue.
Issue reproduces Titanium SDK version 3.4.0 master, 3.3.0.GA, 3.2.3.GA, 3.2.2.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
Any followup on this? i have this issue myself now. Titanium SDK 5.1.2.GA Android device: Nexus 6P, Android 6.0
Is there no easy fix i can do myself? kinda need this fixed
I have the same problem. I need a solution, please.
I need a solution too, please!!!
This seems to be working on *Titanium SDK 6.1.0* *TEST CASE*
!Screenshot_1477320271.png|thumbnail!
Resolving as invalid.
I have verified that this is indeed a bug on Android. It's an issue with the child views added to the ScrollableView. The top-most child view's width/height/top/bottom/left/right properties are ignored. *Reproducible Case:* The below works fine on iOS, but shows the wrong results on Android.
*Work-Around:* The below works on both Android and iOS. It successfully works-around the issue. Note that the solution is to wrap the view with an empty view.
*Technical Reason:* The Titanium child view is being added directly to Android's native "ViewPager", which derives from Android's "ViewGroup". The problem with this is that Google's "ViewGroup" only supports "ViewGroup.LayoutParams", but the Titanium width/height/top/bottom/left/right properties are stored to our custom "TiCompositeLayout.LayoutParams" which are ignored by the parent. The parent view must be a Titanium "TiCompositeLayout" derived view (all Titanium views derive from this class) in order for these custom parameters to be supported. That's why the above work-around works, because the empty Titanium parent view is needed to size/layout the child based on its custom Titanium parameters.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696
FR Passed. Waiting for merger to be enabled.
PR Merged.
*Closing ticket.* Verified fix can be seen in SDK Version:
7.3.0.v20180625114905
*Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/9696