Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3435] TableViewSection.headerView broken on Android

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-07T00:31:23.000+0000
Affected Version/sn/a
Fix Version/sSprint 2012-05, Release 2.0.0
ComponentsAndroid
Labelsapi, dr-list, module_tableview, parity, qe-testadded
ReporterRadu.V
AssigneeHieu Pham
Created2011-04-15T03:45:10.000+0000
Updated2012-10-16T18:54:31.000+0000

Description

HeaderView option works on a TableView, but not on a TableViewSection on Android.

Assigning a custom view to a TableViewSection.headerView will not result in that view being drawn on display.
It does work on iOS without problems, I would love to see it working on Android too so I could do a nice GUI.

Documentation doesn't seem to mention anything related to this.
The code I tested with is similar to KitchenSink demo. I can't run the KitchenSink demo on android, since it
will not install due to the fact it can't find a required library for google maps. There's no error display when
trying to install KitchenSink on my Android phone. (Yes I downloaded the latest version from github)

Expected output (similar to iOS):
http://imm.io/4yR0">http://imm.io/4yR0

Actual output (on Android):
http://imm.io/4yR1">http://imm.io/4yR1

Titanium SDK 1.6.1
Titanium Developer 1.2.2
Compiled for Android SDK 2.2, Android tools version 10

Code attached for test, simple app.js
https://gist.github.com/886885">https://gist.github.com/886885

Thank you for your time.

Comments

  1. Eduardo Gomez 2011-07-28

    Associated HD ticket

    A Customer relies on this, http://appc.me/c/APP-229546

    Environment

    {panel} Product: Mobile Titanium SDK: Mobile 1.6.2 Platform OS: Android Platform OS Version: 2.1, 2.2, 2.3 {panel}
  2. Tamas Rakoczi 2011-08-23

    We also need this functionality in our company's internal app, would be great to have it finally fixed on Android.
  3. Dietrich Streifert 2011-12-16

    This does still not work with: Titanium SDK 1.8.0.1RC Platform OS: Android 2.3.3 This works on iOS as acpected
  4. Jon Alter 2012-02-24

    Confirmed with:

    TiSDK 1.8.1 Android Emulator 2.3.3, V8

    Steps to reproduce:

    Step 1: run the code below Step 2: notice that the pink headerView does not display in Android (it works fine in iOS).
       var win = Ti.UI.createWindow({backgroundColor: 'white'});
       var tableView = Ti.UI.createTableView();
       
       var data = [];
       
       for (var c=0;c<4;c++)
       {
       	data[c] = Ti.UI.createTableViewSection({
       		// headerTitle:'Group '+(c+1),
       		headerView: Ti.UI.createView({backgroundColor: 'pink', height: 40})
       	});
       	for (var x=0;x<10;x++)
       	{
       		data[c].add(Ti.UI.createTableViewRow({title:'Group '+(c+1)+', Row '+(x+1)}));
       	}
       }
       
       tableView.data = data;
       
       win.add(tableView);
       win.open();
       
  5. Wilson Luu 2012-03-07

    Closing bug. Verified fix on: SDK build: 2.0.0.v20120307090205 Runtime: V8, Rhino Titanium Studio, build: 1.0.9.201202141208 Device: Galaxy Tab 10.1 (3.2)
  6. Martin Guillon 2012-10-16

    Can we reopen this one. It crashes on TiTableViewHeaderItem.getRowData wih a null pointer exception! This is normal as in the case of a custom headerView, rowView is null. SDK build: 3.1.0 master Runtime: V* Titanium Studio, build: 1.0.9.201202141208 Device: Simulator
  7. Martin Guillon 2012-10-16

    Even fixing this it still crashes because cell reuse. The custom headerView is not removed from its parent view on reuse. I am not sure on how to fix this

JSON Source