I have one activity with action bar. Action bar contains search view. I don't want that back button which appears when search view is clicked. Is it possible to remove it or hide it? That back button is not visible until I click the search view. By the way the following line of code doesn't help.
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
Menu resource
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
android:title=""
app:showAsAction="always|collapseActionView"
android:icon="@drawable/ic_action_search"
app:actionViewClass="android.support.v7.widget.SearchView" />
</menu>
Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.
All Android devices provide a Back button for this type of navigation, so you should not add a Back button to your app's UI. Depending on the user's Android device, this button might be a physical button or a software button.
I have been dealing with a similar issue. To simply remove the arrow, I changed app:showAsAction="always|collapseActionView"
to app:showAsAction="always"
.
However, now I have a blank space instead of the arrow, which is an issue I have yet to resolve.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With