Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23456] Using "rect" TableViewRow height and width values are always 0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterAnna
AssigneeUnknown
Created2016-05-24T09:57:40.000+0000
Updated2018-02-28T19:55:50.000+0000

Description

All of the values in TableViewRow height and width are always 0. Test case:

<TableView id="table">
  <TableViewRow id="row> 
      <Label> Hello world! </Label
  </TableViewRow>
</TableView>
$.table.addEventListener('postlayout', function (e){
    Ti.API.info("# Row height: " + $.row.rect.height);
});
Log result:

Row height: 0

Comments

  1. Nazmus Salahin 2016-05-24

    Hello, I am able to reproduce this issue. For the given code I get the following log.
       [INFO] :   # Row height: 0
       [INFO] :   # Row height: 0
       [INFO] :   # Row height: 0
       
    *index.xml:*
       <Alloy>
       	<Window class="container">
       		<TableView id="table">
         			<TableViewRow id="row"> 
             			<Label> Hello world! </Label>
         			</TableViewRow>
       		</TableView>
       	</Window>
       </Alloy>
       
    *index.tss:*
       ".container": {
       	backgroundColor:"white"
       }
       
       "Label": {
       	width: Ti.UI.SIZE,
       	height: Ti.UI.SIZE,
       	color: "#000"
       }
       
    *index.js:*
       $.table.addEventListener('postlayout', function (e){
       
           Ti.API.info("# Row height: " + $.row.rect.height);
       
       });
       
       $.index.open();
       
    *Environment*: *Device info:* Nexus7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 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
  2. Sharif AbuDarda 2016-05-24

    Hello, I can reproduce the issue when there is no height is defined in the TableViewRow. But when a height is defined in TableViewRow, I can get the height in "postlayout" as Ti.API.info("# Row height: " + $.row.height); Regards, Sharif.

JSON Source