Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11022] Android: Table row title disappears if a view is added to the table row.

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 2.1.2, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid
ReporterJackieTai
AssigneeUnknown
Created2012-09-18T20:44:44.000+0000
Updated2018-02-28T20:03:41.000+0000

Description

A table with some rows, each row has its own title, if the row contain no any additional view, the title will show correctly, but if an image or label or any view added to the row, the row title will disappear. this problem only happen on android, IOS is fine *here is the test code* {quote}
var win1=Titanium.UI.createWindow({
 title:'Tab 1',
 backgroundColor:'#fff'
});

var tableView=Titanium.UI.createTableView();

if(Ti.Platform.osname==='iphone')
 tableView.style=Ti.UI.iPhone.TableViewStyle.GROUPED;

var tvs=[];

tvs[0]=Ti.UI.createTableViewSection({
 headerTitle:'TVS1'
});

tvs[1]=Ti.UI.createTableViewSection({
 headerTitle:'TVS2'
});

for( i=0;i<2;i++) {
 for( j=0;j<3;j++) {
  var imgSw=Ti.UI.createImageView({
   right:2,
   height:48,
   width:48,
   image:'/KS_nav_ui.png'
  });
  var row=Ti.UI.createTableViewRow({
   height:48,
   title:"Row "+j,
   className:'row'
  });
  row.add(imgSw);//remark this and you will see the row title back  
  tvs[i].add(row);
 }
}
tableView.setData(tvs);
win1.add(tableView);
win1.open(); 

{quote}

Comments

  1. Ivan Skugor 2012-09-21

    I think that row can either have "title" or contain other elements. Those two functionalities can't be mixed. If there is a need to have title in the row that contains other elements, label can be created and added to the row.
  2. JackieTai 2012-09-22

    No No No, Mr Skugor, the very same row with same title and other elements is shown in iphone(IOS), they can be coexist, the reason that I use row title is due to another problem, which is when you add a label to a row, if the user click on the label(the text) instead of the row empty space, the row event will not fire, I know this can be resolve by adding the label event(so now I've duplicated event to maintain, anyway as long as it work), the thing is when you click on the row empty space, the row has a visual effect(a flash on the background)), but if you click on the label there will be no such effect, but if you use row title instead of label, no matter where you click, the row event and visual effect always fire, well it is not a big deal, but it make a big different on user experience. I like to point out, in iphone even when you add a label and you click on the label text, the visual effect is always fire.
  3. jithinpv 2013-02-25

    The issue can be reproduced in titanium sdk version 3.0.2 as well as in 3.1.0 .

JSON Source