开发者

How to set a title for a context menu?

开发者 https://www.devze.com 2023-02-06 10:40 出处:网络
When I bring开发者_运维百科 up the context menu on a contact in the Android built-in app, the context menu has a title (the contact\'s name). Same for playlist context menu in the Music app.

When I bring开发者_运维百科 up the context menu on a contact in the Android built-in app, the context menu has a title (the contact's name). Same for playlist context menu in the Music app.

I have added a context menu to an ImageView (no list item). There is no title, just the options are shown. Is there an easy way to set a title so that my context menu looks like the built-in apps' ones?


You want to use setHeaderTitle(CharSequence title).

0

精彩评论

暂无评论...
验证码 换一张
取 消