android-search

How to remove white underline in a SearchView widget in Toolbar Android

独自空忆成欢 提交于 2019-11-26 19:27:16
问题 I am using Toolbar search widget in my project. Everything works fine but expect the thing which I am completely stuck up with removing the underline below search field in my toolbar. I have tried many solutions and nothing works out. Below are the some of the solutions what i tried. Requirement is to remove white underline in the image Ist Solution: //Removing underline int searchPlateId = searchView.getContext().getResources().getIdentifier("android:id/search_plate", null, null); View

SearchView in expanded mode doesn't hide all action bar icons starting from Marshmallow

喜你入骨 提交于 2019-11-26 18:43:28
问题 SearchView looks fine on Lollipop devices (Android 21): But on Android 23-28 it doesn't hide all icons on the right side: <item android:id="@+id/action_search" android:title="@string/search" app:actionViewClass="androidx.appcompat.widget.SearchView" app:showAsAction="ifRoom"/> <item android:id="@+id/action_sort" android:title="@string/sorting" android:icon="@drawable/sort" app:showAsAction="ifRoom"/> How can I fix it? Update Seems Android 23 and higher don't hide icons anymore on the right

MenuItemCompat.getActionView always returns null

折月煮酒 提交于 2019-11-26 18:21:01
I just implemented the v7 AppCompat support library but the MenuItemCompat.getActionView always return null in every Android version I tested (4.2.2, 2.3.4 ....) The SearchView is displayed in action bar but it doesn't respond to touch actions and doesn't expand to show its EditText and is just like a simple icon. @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); MenuItem searchItem = menu.findItem(R.id.action_search); SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem); if

MenuItemCompat.getActionView always returns null

折月煮酒 提交于 2019-11-26 08:54:54
问题 I just implemented the v7 AppCompat support library but the MenuItemCompat.getActionView always return null in every Android version I tested (4.2.2, 2.3.4 ....) The SearchView is displayed in action bar but it doesn\'t respond to touch actions and doesn\'t expand to show its EditText and is just like a simple icon. @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); MenuItem searchItem = menu.findItem(R.id