Changing the context menu style in Android

In one Android activity, I added a context menu to ImageView with only one menu item: Close (to hide the image). However, the context menu does not look very good when shown expanding a large white rectangle occupying almost the entire wide screen. Is there a way to reduce the size of this rectangle to cover only the word "Close" ?. This is my main question, but any pointer to how to change other styles of the context menu will be appreciated (for example, background color or font / text color). Thanks!

+4
source share
1 answer

I don’t think it’s possible to set the width of a menu item.

However, you can find a great article here that shows how to customize the look of your menu item.

0
source

Source: https://habr.com/ru/post/1393074/


All Articles