Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27935] iOS: TableViewRow does not return getRect methods

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2020-11-20T15:09:21.000+0000
Affected Version/sRelease 9.0.2, Release 9.1.0
Fix Version/sRelease 9.3.0
ComponentsiOS
Labelsn/a
ReporterSamir Mohammed
AssigneeGary Mathews
Created2020-06-04T13:23:58.000+0000
Updated2020-11-20T15:09:21.000+0000

Description

When trying to get the rect.height the value does not change even through the tableViewRow height is increasing/changing. On the Android side this is working fine and the value is returned. *Test Case:*
win = Ti.UI.createWindow({
backgroundColor: '#AAAAFF',
layout: 'vertical'
});

var top = Ti.UI.createView({
backgroundColor: '#FFAAAA',
layout: 'horizontal',
height: Ti.UI.SIZE,
width: Ti.UI.FILL
});

var btnPlus = Ti.UI.createButton({title: '+', top: 50, color: 'white', borderWidth:2 });
btnPlus.addEventListener('click', function() {
console.log('plus click');
view.height += 50;
});

var btnMinus = Ti.UI.createButton({title: '-', top: 50, color: 'white', borderWidth:2 });
btnMinus.addEventListener('click', function() {
console.log('minus click');
view.height -= 50;
});

var label = Ti.UI.createLabel();

var tableView = Ti.UI.createTableView();

var row = Ti.UI.createTableViewRow({
height: Ti.UI.SIZE,
width: Ti.UI.FILL
});

var view = Ti.UI.createView({
height: 150,
backgroundColor: 'blue'
});

row.add(view);
tableView.setData([ row ]);
tableView.addEventListener('postlayout', function onPostLayout() {
console.log('postlayout', row.rect.height, view.rect.height);
label.text = [row.rect.height, view.rect.height].join(' \| ');
});

top.add(btnPlus);
top.add(btnMinus);
top.add(label);

win.add(top);
win.add(tableView);
win.open();
*Test Steps:*

Create a new application with the code above

Run the application

Click on the Minus and Plus buttons

Notice label does not change with the correct the values (even though height of the tableViewRow changes)

Comments

  1. Vijay Singh 2020-06-05

    PR - https://github.com/appcelerator/titanium_mobile/pull/11758
  2. Satyam Sekhri 2020-06-11

    FR Passed
  3. Satyam Sekhri 2020-07-29

    Verified on: Mac OS: 10.15.4 SDK: 9.1.0.v20200727104531 Appc CLI: 8.1.0-master.7 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202005141803 Xcode: 12.0 beta Device: iOS simulator 14.0 beta, 13.5
  4. Vijay Singh 2020-09-28

    This is causing regressions. Reverted changes in [PR](https://github.com/appcelerator/titanium_mobile/pull/12128). Need to look in alternate way to fix it.
  5. Gary Mathews 2020-10-27

    master: https://github.com/appcelerator/titanium_mobile/pull/12225
  6. Satyam Sekhri 2020-11-03

    FR Passed. Waiting for Jenkins build
  7. Christopher Williams 2020-11-03

    merged to master, backport to 9_2_X also merged
  8. Samir Mohammed 2020-11-20

    *Closing ticket*. Fix verified in SDK version 9.3.0.v20201119063936. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/12225

JSON Source