{ "id": "62321", "key": "TIMOB-1689", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11364", "description": "Mobile 1.8.0 M11", "name": "Sprint 2011-32", "archived": true, "released": true, "releaseDate": "2011-08-15" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-10-27T15:42:31.000+0000", "created": "2011-04-15T02:59:26.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11367", "description": "", "name": "Release 1.7.1", "archived": true, "released": true, "releaseDate": "2011-06-21" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-11-16T14:21:01.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Based on the official Titanium Mobile documentation the\r\nSearchBar component can have a background image but, right now in\r\nthe 1.4.0 version this property is ignored.
\r\nFor coherence with the rest of the API i think it's important to\r\nimplement the barImage property just like in the Window object, so\r\nwe can completely customize the UI.

{html}", "attachment": [], "flagged": false, "summary": "SearchBar doesn't correctly show background image", "creator": { "name": "bigluck", "key": "bigluck", "displayName": "BigLuck", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "158818", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "I believe the documentation is wrong, and we can't really add backgroundImage etc to the TiSearchBar. It's a light wrapper around the UISearchBar. What we could do is add a special case for when you set the barColor to \"transparent\" to get rid of the gradient. That would free you up to place a view behind the search bar, and customize it however you like. That would actually help out quite a few customers, and it would keep good consistency with Android.\r\n\r\nWhat do you think, Reggie? Something like this:\r\n\r\n{code:title=iphone/Classes/TiUISearchBar.m}\r\n...\r\n-(void)setBarColor_:(id)value\r\n{\r\n\tUISearchBar *search = [self searchBar];\r\n\tif ([value isEqualToString: @\"transparent\"]) {\r\n\t\t[search setBarStyle:UIBarStyleBlack];\r\n\t\t[search setTranslucent:YES];\r\n\t\t[[search.subviews objectAtIndex:0] removeFromSuperview];\r\n\t}\r\n\telse {\r\n\t\tTiColor * newBarColor = [TiUtils colorValue:value];\r\n\t\t[search setBarStyle:[TiUtils barStyleForColor:newBarColor]];\r\n\t\t[search setTintColor:[TiUtils barColorForColor:newBarColor]];\r\n\t\t[search setTranslucent:[TiUtils barTranslucencyForColor:newBarColor]];\r\n\t}\r\n}\r\n...\r\n{code}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-07-06T15:03:31.000+0000", "updated": "2011-07-06T15:03:31.000+0000" }, { "id": "158819", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "We have a pro customer interested in this now.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-07-06T15:04:15.000+0000", "updated": "2011-07-06T15:04:15.000+0000" }, { "id": "162441", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Question: As it is, when you do transparent, you do have the transparent black search field that you'd get natively. Wouldn't this new custom behavior break apps of other customers using this?", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-10T10:47:21.000+0000", "updated": "2011-08-10T10:47:21.000+0000" }, { "id": "162465", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "@Blain: Yup, good point. So maybe some other string would work here? What about \"none\"?", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-08-10T12:43:23.000+0000", "updated": "2011-08-10T12:43:23.000+0000" }, { "id": "162493", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I did some R&D, and I found no combo that got better than the black translucent you see currently for 'transparent'. Worse, removing the subview index 0 could lead to some oddities. (IE, what if it's been already removed? What if searchBar changes this undocumented structure in the next release? Would this lead to requests to support 'none' elsewhere?)\r\n\r\nHOWEVER, the primary issue was that the customer couldn't customize the UI. We already have a property that's supposed to work, called backgroundImage, that there's a precedent for. Were the backgroundImage be properly placed over the default bar graphic but under the text field and buttons, that should solve the need. I have a working code that does that ready to commit/push. Sound good?", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-10T14:50:29.000+0000", "updated": "2011-08-10T14:50:29.000+0000" }, { "id": "164370", "author": { "name": "vsingh", "key": "vsingh", "displayName": "Vikramjeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested On: \nMac OSX Lion\nTiMob: 1.8.0v20110819142548\nTiStud: 1.0.4.201108101535\n\nDevices:\niPhone4 version 4.2.10\niPad2 version 4.3.5\niPod 3", "updateAuthor": { "name": "vsingh", "key": "vsingh", "displayName": "Vikramjeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-29T12:10:02.000+0000", "updated": "2011-08-29T12:10:02.000+0000" }, { "id": "164475", "author": { "name": "benlebt", "key": "benlebt", "displayName": "Ben S.", "active": true, "timeZone": "America/Los_Angeles" }, "body": "So can we have a searchbar with transparent background now? ", "updateAuthor": { "name": "benlebt", "key": "benlebt", "displayName": "Ben S.", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-30T02:46:06.000+0000", "updated": "2011-08-30T02:46:06.000+0000" }, { "id": "172983", "author": { "name": "scourse", "key": "scourse", "displayName": "steve course", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello\r\nsetting the searchbar to barColor 'transparent' still gives the gradient background\r\nios 5.0\r\n1.80 beta\r\ndo I have to make specific other changes to get the searchbar transparent so background view from behind searchbar is visible?\r\n\r\nthanks", "updateAuthor": { "name": "scourse", "key": "scourse", "displayName": "steve course", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-16T14:02:42.000+0000", "updated": "2011-11-16T14:02:42.000+0000" }, { "id": "172993", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "@Ben S and @Steve Course: Setting barColor to transparent won't give you a transparent background. The gradient background image will always be there. But the backgroundImage property works properly now so that you can overlay an image on top of it. It isn't transparency, but it's what we can offer. If that doesn't work, you need to work on creating your own search bar (through the creative usage of text fields, buttons, or whatever else you can think of). This is what Apple gives us to work with.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-11-16T14:21:01.000+0000", "updated": "2011-11-16T14:21:01.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }