SearchView

API Reference: UI.SearchBar

SearchView is a UI object in which the user can enter a search query and submit a request to the search provider.

JavaScript
JavaScript
const Page = require("sf-core/ui/page");
const extend = require("js-base/core/extend");
const Color = require('sf-core/ui/color');
const FlexLayout = require('sf-core/ui/flexlayout');
const SearchView = require('sf-core/ui/searchview');
var Page1 = extend(Page)(
function(_super) {
_super(this, {
onShow: function(params) {
Application.statusBar.visible = false;
this.headerBar.visible = false;
}
});
this.layout.justifyContent = FlexLayout.JustifyContent.CENTER;
var mySearchView = new SearchView({
marginLeft: 20,
marginRight: 20,
onTextChanged: function(searchText) {
console.log("searched text : " + searchText);
}
});
this.layout.addChild(mySearchView);
}
);
module.exports = Page1;

Known Issue

Set the border width to '0' after all SearchView configurations are completed on iOS. If this flow is not followed, the zero value will not work properly.