Problem
We have a number of views with tableviews that use the SearchView component. When compiling for iOS, we receive this warning:
[WARN] <SearchView> is only available in Android
[WARN] To get rid of this warning, add platform="android" to your <SearchView> element
However, our SearchView elements already have the platform attribute set to "android".
Test case
<Alloy>
<Window>
<TableView>
<SearchBar platform="ios"/>
<SearchView ns="Ti.UI.Android" platform="android"/>
</TableView>
</Window>
</Alloy>
Logs
[INFO] [index.xml] view processing...
[INFO] style: "index.tss"
[INFO] view: "index.xml"
[WARN] <SearchView> is only available in Android
[WARN] To get rid of this warning, add platform="android" to your <SearchView> element
[INFO] controller: "index.js"
[TRACE] - Processing "builtins" module...
[TRACE] - Processing "optimizer" module...
[TRACE] - Processing "compress" module...
[INFO] created: "Resources/iphone/alloy/controllers/index.js"
[DEBUG] map: "build/map/Resources/iphone/alloy/controllers/index.js.map"
[INFO] created: "Resources/iphone/alloy/styles/index.js"
Notes
I believe the error is in commands/compile/parsers/Ti.UI.TableView.js:49. It currently reads:
if (node.getAttribute('platform') !== 'android') {
I believe it should read:
if (child.getAttribute('platform') !== 'android') {
Interesting, how does it behave it ListViews? Didn't see the warning there. Thanks! -Please make a PR for Alloy to fix it if possible.- I will make a PR for you.
PR: https://github.com/appcelerator/alloy/pull/794
PR merged.