[TIMOB-16629] Android: Adding a View/ImageView with Ti.UI.FILL width and height to ListView does not work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-01-09T22:17:40.000+0000 |
Affected Version/s | Release 3.2.2 |
Fix Version/s | n/a |
Components | Android |
Labels | android |
Reporter | Anh Nguyen |
Assignee | Unknown |
Created | 2014-03-13T17:14:27.000+0000 |
Updated | 2020-01-09T22:17:40.000+0000 |
Description
Trying to Add one View with Indicator on ListView by using add() function
//-------- CODE ----------------
var Wv = Ti.UI.createView({
backgroundColor: 'yellow',
width:Ti.UI.FILL,
height:Ti.UI.FILL,
//top:0,left:0,right:0,bottom:0, //Try it but does not work
});
var style;
if (Ti.Platform.name === 'iPhone OS'){
style = Ti.UI.iPhone.ActivityIndicatorStyle.DARK;
}
else {
style = Ti.UI.ActivityIndicatorStyle.DARK;
}
var Indicator = Ti.UI.createActivityIndicator({
color: 'black',
message: ' '+ 'Loading...Please wait...',
style: style,
});
Wv.add(Indicator);
Indicator.show();
var ListView = Ti.UI.createListView({
backgroundColor: 'white',
width:Ti.UI.FILL,
height:Ti.UI.FILL,
//top:0,left:0,right:0,bottom:0,
});
ListView.add(Wv);
var win = Ti.UI.currentWindow;
win.add(ListView);
//----------- END CODE -----------
The Wv View always shows at Position: (0,0), and does not fill out on ListView.
It works on iPhone/iOS Simulator and Device
but It does not work on Android
Attachments
File | Date | Size |
---|---|---|
Android.png | 2014-03-13T17:14:27.000+0000 | 82445 |
iOS .png | 2014-03-13T17:14:27.000+0000 | 16836 |
Screen Shot 2014-03-13 at 10.43.27 PM.png | 2014-03-14T05:43:56.000+0000 | 22834 |
I was not able to run your code as it is so I modified it to run but I cannot reproduce the same behavior on iOS or Android platform. Can you please provide a complete but simple test case to reproduce this issue? I am attaching my screenshot for iOS platform that is different from yours.
Sorry Ritu, Just skip the Navigation Bar on the top of window. It's just another View that contains some button. I have edited my code to show indicator. The yellow View fills to both width and height as expected on iPhone. but it does not fill to fit width and height on Android.
Moving this ticket to engineering as I can reproduce the issue with an updated test case. Note that if I add the view in the test case to window directly (instead of adding it to List View) then both iOS and Android behave same. So this issue is specific to ListView. Updated test case
Issue reproduces Titanium SDK version 3.4.0 master, 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 iOS simulator : iPhone Retina (3.5-inch), iOS 7.0.3
This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.