Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-11502

Android: TableView - Application crashes when adding a TableViewSection with headerView

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 2.1.3
    • Component/s: Android
    • Environment:

      Description

      Problem

      I have a fairly simple TableView in my app which crashes only when compiled with SDK 2.1.3. Inside the DDMS log attached you can find the exception thrown. The cause of the crash seems to be the headerView of the TableViewSection. Using the following test case the app crashes in the Android Emulators 4.0.3 and 4.1 on both WVGA800 and WXGA720 screen, but inside my app this code crashes only when ran on the WXGA720 screen.

      Test case

      var self = Ti.UI.createWindow({
      		backgroundColor: "#ffffff",
      		tabBarHidden: true
      	});
       
      var tableViewData = [];
      	
      var tableView = Ti.UI.createTableView({
      	style:Titanium.UI.iPhone.TableViewStyle.GROUPED,
      });
       
      self.add(tableView);
       
      var headerView = Ti.UI.createView({
      	height: 90,
      	borderColor: 'transparent',
      	borderWidth: 0,
      });
       
      var headerImageContainer = Ti.UI.createView({
      	left: 19,
      	height: 64,
      	width: 64
      });
      	
      headerImageContainer.add(Ti.UI.createView({
      	backgroundImage: '/images/person.png',
      	width: 64,
      	height: 64,
      	borderColor: '#a9a9a9',
      	borderRadius: 4,
      	borderWidth: 1,
      	
      }));
       
      headerView.add(headerImageContainer);
       
      tableViewData.push(Ti.UI.createTableViewSection({
      	headerView: headerView,
      }));
       
      tableView.data = tableViewData;
       
      self.add(tableView);
       
      self.open();
      

        Attachments

          Activity

            People

            • Assignee:
              ayeung Allen Yeung
              Reporter:
              lucassp Lucian Pacurar
            • Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code