Remove Floating menu button from HTC one

最后都变了- 提交于 2019-12-24 15:33:40

问题


I have an app that's been running for years, and constantly get's updated. Originally it had a menu with some shortcuts, but it's not necessary to operate the app, so no big deal as the menu button started to disappear from new devices.

Now I have a customer complaining that a floating menu button appears on he's HTC one, and it actually covers some other buttons in my app. (That's not the case on my Samsung S5 nor Lenovo Yoga tablet)

I've removed "onCreateOptionsMenu" and "onOptionsItemSelected" from my activity, and I can no longer access the menu on my devices, but the HTC user says the floating menu button is still on he's HTC, it just doesn't do anything.

How do I remove that button?


回答1:


In your onCreateOptionsMenu() do this

MenuItem settingsItem = menu.findItem(R.id.action_settings);
settingsItem.setVisible(false);



回答2:


You have to set your targetSdk higher then 13 in your gradle build files.

Thanks to the answer of Ankush Sharma https://stackoverflow.com/a/33086729/2607567.



来源:https://stackoverflow.com/questions/29495066/remove-floating-menu-button-from-htc-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!