Reputation: 629
I've got a text input in my app which I use as a search bar and I know that Android has an API to display a search type keyboard and I'm wondering how I can use it in react-native.
I've looked in the react-native text input documentation but didn't find anything for that type of keyboard in Android.
Anyone knows which type of keyboard I can use in text input to achieve wanted result?
Upvotes: 3
Views: 8789
Reputation: 11
It seems like you want to show a keyboard layout that has a search icon in the bottom right corner, similar to:
There is a property called returnKeyType
, and if you set its type to search
, you'll see the desired layout:
Example:
<TextInput placeholder='Search...'
returnKeyType="search" // This will show the search icon
onSubmitEditing={handleSearch} // This handles the search icon press
value={searchText}
onChangeText={(text) => setSearchText(text)}/>
Upvotes: 1
Reputation: 668
Looks like you're looking for returnKeyType and keyboardType
Upvotes: 15