开发者

How to set a title for a context menu?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜