GitHub Issue | n/a |
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-09T10:34:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | iOS |
Labels | backgroundColor, ios, listView, searchBar |
Reporter | Lorenzo Piccinini |
Assignee | Vijay Singh |
Created | 2015-12-09T15:27:48.000+0000 |
Updated | 2018-05-09T10:35:30.000+0000 |
I have a window with backgroundImage and a listView with backgroundColor transparent and labels of all item white.
When I click on searchBar and start typing the backgroundColor of listView became white and the results are unreadable because item's labels have the same color of background.
Android work fine with the same component Ti.UI.createSearchBar
Hello, See the below code. I used opacity in the listview. The list items are visible.
Hope this helps, Thanks.
Thank you for you solution but I don't like very much. Here my code with the bug:
Hello, This is a default searchbar behavior. It's not a bug. This is the way it has worked on iOS for a long time now. The only answer would appear to be to modify the source. Here are some of the link ou can follow 1. [Link1](http://developer.appcelerator.com/question/155212/searchbar-results-tableviews-background-color-doesnt-change-can-it-be-a-bug). 2. [Link2](https://developer.appcelerator.com/question/151120/change-background-color-of-empty-search-result-rows). Hope this helps, Thanks.
Reopening, it's a valid improvement.
Any news about it?
Hey there! We recently had a discussion about the interface architecture of this API on Github and the changes are in place. The PR is coming over the next 1-2 days. Thanks!
Fantastic!! Thank you very much!
PR: https://github.com/appcelerator/titanium_mobile/pull/8006 Note: Please do not merge before next week, since it's dated for 6.0.0 [~otto.pic] can you test the changes? Thanks!
Hans Knoechel, sure, I can test it in my app, but I have never done it before, can you explain me how to procede? Should I replace the files in my sdk? Thanks
Probably the easiest way to proceed, yes. You can replace it in
~/Library/Application Support/Titanium/mobilesdk/osx/<YOUR_SDK_VERSION>/iphone/Classes/TiUiListView.m
. Written from the brain, place verify the path. Thanks!I have tried to replace TiUiListView.m in my current sdk 5.2.2 and set resultsBackgroundColor: 'transparent' to my listview but I have not obtained transparent results. Any suggests?
I have tried with resultsBackgroundColor : 'red' and background result is correctly red, so the problem is the param "transparent"
Code reviewed ok. As Lorenzo has mentioned, the param "transparent" is not working for resultsBackgroundColor.
Any news about it? Do you fixed transparency?
Unfortunately not, yet. It seems to make problems on the native side as well. Need more time to figure out a proper solution.
Hi guys, I tried to set resultsBackgroundColor in my ListView constructor to red, but when I search listView, the backgroundColor is still white. Can you please post full example how to set this to make it work? Thank you
[~max87] The improvement is not in the SDK, yet. See that this ticket has the status
Open
. Although every color works, I don't want to submit the changes to review when knowing that the transparent color does not work. Or we would need to be aware of that glitch which doesn't look solid to me.Marian Kucharcik you can use the unofficial fix by hans https://github.com/appcelerator/titanium_mobile/pull/8006 I'am using and it's works. @Hans. I can understand your non submission, it's not 100% perfect because you seems still have a issue with transparency. But 1) You fixed the bug and 2) you add setBackground and setSeparatorInset who are great functions. I know it's not perfect but maybe you should submit and display a warning for the transparency using ? For all people who have to edit their latest sdk with your PR manually :)
PR: https://github.com/appcelerator/titanium_mobile/pull/8006 Demo (adjusted from above):
Notes: I updated the docs to 6.1.0 and added support for a transparent background-color hack. I still Apple prevents this natively, since the result will show the below list-view that will overlap the contents. This happens because the search-results list is natively above the main list-view. I used a hack to generate a white color with a 0.0001 opacity and left a note about the non-official support. I guess we are pretty good with that. Alternatively, we would not have set it and throw a warning if used.
CR and FT Passed!
I tried to use it like Baharroth mentioned and it works! Great job guys, thank you.
Verified improvement with the code provided by [~hansknoechel], Was able to see the background turn red when text was entered and that the text was still visible. *Environement*
[~ewieber] We got an email today which referenced this ticket and said "_This problem is resolved for Listview but not for Tableview. I think it's not a bug but the default behaviour on iOS, but with a black app interface.. it's a quite bad experience_." Can you try to reproduce? If it's valid, I'll reopen this ticket.
[~amukherjee], [~hknoechel]: I am able to reproduce the issue in TableView. I am including code for an example that has a TableView example with the ListView example already in this ticket. Can we apply the changes made to ListView to TableView? The search results being on top of the contents is very annoying, but if Apple won't let us do anything about it, this is a good workaround.
[~hknoechel] has made PR for this only in ListView. Simply copying the code in TableView should work.
PR - https://github.com/appcelerator/titanium_mobile/pull/10033 Test Case -
Closing ticket again, since the parity (Ti.UI.TableView) is handled in TIMOB-26021 to keep the versioning scope clean.