Using Android Studio default search icon for searchView
You can also access this list of icons in https://material.io/icons/ from Android Studio
iBEK
Updated on June 14, 2022Comments
-
iBEK almost 2 years
Can't seem to find the right search icon for the searchView for my actionBar. Does Android Studio even offer a non-bad one or do I have to create my own?
Here's what's offered in Android Studio: ( I want to have all white icons)
android:icon="@android:drawable/ic_menu_search"
This search icon doesn't work for me.
===============================================
Here's another Android Studio icon that won't work with my white icons:
android:icon="@android:drawable/ic_search_category_default"
==============================================
android:icon="@drawable/ic_search_black_24dp"
The final Android Studio available search icon from Image Asset Folder --> Clip Art. It's finally a white icon but it's positioned higher than the settings icon. Don't know why.
I need a white icon like the last one but to be in the same position as the settings Icon. Is there any way to lower icon without making it look odd on other phones? Do I have to create my own icon and if so, what sizes? Why does Android Studio put the white search Icon so high up compared to others?
-
Mohammed Gamal over 6 yearscheck material.io/icons
-
iBEK over 6 yearsAre these open source?
-
Mohammed Gamal over 6 yearsYes you can use them in your app
-
iBEK over 6 yearsWhatever, I don't find in Android Studio, i'll certainly consider using these material icons, thank you.
-
Mohammed Gamal over 6 yearsCheck my answer
-
-
iBEK over 6 yearsMy 3rd and white search icon above is from Image Asset folder.
-
Mohammed Gamal over 6 yearsDo You have layout for the action bar ?
-
Mohammed Gamal over 6 yearsYeah I Know , Try To Download the search icon from the website and use it with size 48Dp and check
-
Mohammed Gamal over 6 yearsYou can add custom view for action bar LayoutInflater inflator = (LayoutInflater) this .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflator.inflate(YOUR VIEW, null); actionBar.setCustomView(v);
-
iBEK over 6 yearsAlright, thank you, i'll give it a try. Thanks for all your help.
-
Mohammed Gamal over 6 yearsYou are welcome :) , If it worked don't forget to vote up :)