Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11994] iOS: Can't use SearchBar with headerView in TableView

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.0.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsreprod
ReporterTony Lukasavage
AssigneeUnknown
Created2012-12-07T18:36:09.000+0000
Updated2018-02-28T20:04:09.000+0000

Description

problem

In a Ti.UI.TableView on iOS, you cannot use the *search* property's Ti.UI.SearchBar if you have also specified as *headerView*. You won't encounter any errors, you will just not get the SearchBar in your app. You will only see the headerView. If this is the expected behavior, I did not see it documented with respect to the Ti.UI.SearchBar in the API docs.

expected behavior

The SearchBar would be anchored at the top of the table with the headerView under it.

test case

var win = Ti.UI.createWindow({
	backgroundColor: '#fff'
});

var data = [];
for (var i = 0; i < 25; i++) {
	data.push({title:'row '+(i+1)});	
}
var table = Ti.UI.createTableView({
	search: Ti.UI.createSearchBar(),
	headerView: Ti.UI.createView({
		backgroundColor: '#a00',
		height: 50
	}),
	data: data
});

win.add(table);
win.open();

Attachments

FileDateSize
Screen Shot 2013-11-04 at 10.06.00 AM.png2013-11-04T15:07:38.000+000039250
Screen Shot 2013-11-04 at 10.06.08 AM.png2013-11-04T15:07:38.000+000041340
TestTableViewHeader.tar.gz2014-05-15T13:50:03.000+00005122649

Comments

  1. jithinpv 2013-03-22

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) iOS iPhone Simulator: iOS SDK version: 6.0 jithinpv
  2. Tony Lukasavage 2013-11-04

    For reference, I've attached 2 screenshots. One shows the ListView behaving as expected. The other shows an equivalent TableView not showing the SearchBar, despite having specified it along with the headerView.
  3. Lee Morris 2017-06-19

    I am able to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170609091155 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source