[AC-3658] Android - Wrong view size
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2016-05-29T10:15:55.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy, Titanium SDK & CLI |
Labels | android-4.4 |
Reporter | Anna |
Assignee | Shak Hossain |
Created | 2016-05-25T11:06:26.000+0000 |
Updated | 2016-05-29T10:15:55.000+0000 |
Description
I have a view named "pie" and I set a height, but when I get his height after postlayout event this value is different.
Test device: Android 4.4 Samsung Core 2
controller.xml
<View id="board">
<View id="pie"></View>
</View>
controller.tss
"#pie":{
height: 47
}
controller.js
$.board.addEventListener('postlayout', function(e){
Ti.API.info("## Pie height: " + $.pie.size.height);
});
Log:
"## Pie height: 5"
Hello [~amurcia], Thanks for reaching out. To identify the cause of the issue we need to reproduce it. For that please provide full test code that we can run and reproduce the issue. Once the problem is identified we will be able to give you solution. Regards
You have the test code in the description
Hello [~amurcia], The code you provided seems to be part of a full project. I was wondering if the view has parent or not. Please let us know if the given code reproduces the issue or something else is needed to add. Thanks for your co-operation
Hello, I have tested the issue in my environment and found that
view.size.height
gives correct result. Here is my log for the following code. *Log:**index.xml:*
*index.js:*
*index.tss:*
*Environment*: *Device info:* Nexus7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA and 5.4.0.v20160509133737 *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0