Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15667] iOS: TableViewRow (with custom layout) hasCheck don't works correctly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-03-14T21:43:21.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 05, 2014 Sprint 05 API
ComponentsiOS
Labelscustom, hascheck, ios7, layout, tableviewrow
ReporterEduardo Silva
AssigneeVishal Duggal
Created2013-11-04T19:22:45.000+0000
Updated2017-03-21T22:05:34.000+0000

Description

A TableViewRow (with custom layout) hasCheck don't works correctly in iOS7. The hasCheck property changed (I see in log), but the symbol remains in screen. The check symbol appears and disappear, but I need tap in the row many times. The check symbol don't match with the hasCheck value. custom_tableviewrow.xml
<Alloy>
    <TableViewRow id="row" onClick="select">
        <ImageView id="image" class="brandDefault" />
        <Label id="titleLabel" class="h3"/>
    </TableViewRow>
</Alloy>
custom_tableviewrow.js
 
var args = arguments[0] || {};
$.row.hasCheck   = false;
$.titleLabel.text = args.get("name");
$.image.image  = args.get("imagePath");
function select(e) {
    if($.row.hasCheck == false) {
        $.row.setHasCheck(true);
    } else {
        $.row.setHasCheck(false);
    }
}
custom_tableviewrow.tss
 
"#row": {
    layout:"horizontal",    
    width:Ti.UI.FILL,
    height:"40dp",
    selectedBackgroundColor:"#ccc",
    selectedColor:"#000"
}
 
"#image": {
    width:"40dp", height:"40dp"
}
 
".brandDefault": {
    image: "/images/brand_default.png",
    defaultImage: "/images/brand_default.png"   
},
 
"#titleLabel": {
    textAlign:"left",
    width:Ti.UI.SIZE,
    height:Ti.UI.FILL,
    backgroundColor:"transparent",
    color:"#000"
}
If I try use only the title property in row (removing the layout) it's works fine. :/

Comments

  1. Sebastien JACQ 2013-11-06

    In addition to the post from Eduardo. The value of the hasCheck property is correctly changed for the row. If you scroll the table enough to put the clicked row out of sight and scrollback, the mark appears. A solution to correct this is to re-render the table with *table.setData(table.data)*
  2. Stephen Feather 2013-12-16

    Same here. Only, in my case, the check mark seems to be white. Row with no backgroundColor declared: !http://content.screencast.com/users/Stephen_Feather/folders/Jing/media/be72c944-8149-4291-8516-1703eadbe541/00000254.png! Row with a blue backgroundColor declared: !http://content.screencast.com/users/Stephen_Feather/folders/Jing/media/c8bbb364-a873-4de0-b96b-befb9593e3a0/00000253.png! tintColor and color have no effect.
       "#tableRow":{
       	height: 65,
       	tintColor: "#000000",
       	color: "#000000"
       }
       
    Titanium SDKs: 3.3.0.v20131127225644 Xcode: 5.0.2 (build 5A3005) iOS SDKs: 7.0.3 Titanium CLI CLI Version = 3.2.0
  3. Vishal Duggal 2014-03-14

    @[~sfeather] There is no support for TintColor on TableViewRow and ListItem. I have created another ticket to track that issue TIMOB-16628
  4. Vishal Duggal 2014-03-14

    This is the Common JS Code I used to test. Going to mark the issue as can not reproduce
       Ti.UI.setBackgroundColor('#000');
       var win = Ti.UI.createWindow({
         backgroundColor: 'black',
         fullscreen: true,
         title: 'TableView Demo'
       });
       
       var row = Ti.UI.createTableViewRow({
           layout:"horizontal",    
           width:Ti.UI.FILL,
           height:"40dp",
           selectedBackgroundColor:"#ccc",
           selectedColor:"#000"
       });
         
       var imageAvatar = Ti.UI.createImageView({
           width:"40dp", height:"40dp",
           image:'/images/flower.jpg'
       });
       row.add(imageAvatar);
         
       var labelUserName = Ti.UI.createLabel({
           textAlign:"left",
           width:Ti.UI.SIZE,
           height:Ti.UI.FILL,
           backgroundColor:"transparent",
           color:"#000",
           text:'FRED SMITH'
       });
       row.add(labelUserName);
         
       row.hasCheck = false;
       
       row.addEventListener('click',function(e){
           if(e.row.hasCheck == false) {
               Ti.API.info('TRUE');
               e.row.setHasCheck(true);
           } else {
               Ti.API.info('FALSE');
               e.row.setHasCheck(false);
           }
       })
       
       var tableView = Ti.UI.createTableView({
         backgroundColor:'white',
         data:[row],
       });
       
       win.add(tableView);
       win.open();
       
  5. Vishal Duggal 2014-03-14

    Please attach complete test case to reproduce issue if it exists
  6. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source