Context menu for blank space in a listview

橙三吉。 提交于 2019-12-02 12:16:38

I don't think that long clicking anywhere on the ListView to get a ContextMenu it's a normal behavior, one the user will expect(especially in your case, with the user clicking the empty space below the ListView and a ListView ContextMenu would appear).

Anyway, for your example, you can set your ListView height attribute to wrap_content(If I remember right, this is the recommended value) and then register the Contextmenu for the ListView and the parent LinearLayout(of course you'll have to provide the same code for both).

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