[TIMOB-7337] Android: Size.height and size.width are 0 for Views with height: "auto" and layout: "vertical"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-01-31T11:25:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | 1.8.0.1, android, v8 |
Reporter | Justin Toth |
Assignee | Mauro Parra-Miranda |
Created | 2012-01-23T10:14:36.000+0000 |
Updated | 2017-03-24T18:31:18.000+0000 |
Description
Using Ti 1.8.0.1 with Android and V8, Views with height: "auto" and layout: "vertical" have their size.height and size.width properties set to 0, even after the window is opened.
Here is code to reproduce:
var win = Ti.UI.createWindow({ backgroundColor: "#fff" });
win.addEventListener("open", function() {
//create view.
var view = Ti.UI.createView({ left: 0, right: 0, top: 0, layout: "vertical", height: "auto" });
//create labels.
var label1 = Ti.UI.createLabel({ text: "label 1", color: "#000", top: 0, left: 0, height: "auto" });
view.add(label1);
var label2 = Ti.UI.createLabel({ text: "label 2", color: "#000", top: 0, left: 0, height: "auto" });
view.add(label2);
win.add(view);
//output view dimensions.
Ti.API.info("view width: " + view.size.width);
Ti.API.info("view height: " + view.size.height);
});
win.open();
Results:
android 2.2 emulator (V8): view width: 0, view height: 0 <--incorrect
droid x2 w/android 2.3.4 (V8): view width: 0, view height: 0 <--incorrect
iphone simulator: view width: 320, view height: 44 <--correct
Possible duplicate of TIMOB-5303. Mauro to investigate.
This is a duplicate of TIMOB-5303.
If that is the case, can you at least update the priority level of TIMOB-5303 to critical? It is nearly impossible to build applications to support multiple resolutions in Android without access to the size properties on any elements.
Justin, thanks for your feedback. I talked with Platform Team, and they raised the priority. Will be fix ASAP. Please continue being as good as you are in the community and in this examples. I'm open to hear any opinion, bug or anything that will help to improve the platform. Best, Mauro mpmiranda@appcelerator.com
Closing ticket as duplicate with reference to the linked issues.