`
dengyin2000
  • 浏览: 1207267 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

actionbar中使用ActionProvider显示自定义子菜单

 
阅读更多
http://developer.android.com/guide/topics/ui/actionbar.html#ActionProvider
http://stackoverflow.com/questions/19439106/cant-display-sub-menu-for-custom-actionprovider

Unfortunately, onPrepareSubMenu() is only called when onCreateActionView() returns null. Your solution (attaching a PopupMenu to the ImageView) will work, but since your ImageView is displaying an icon, you might consider just setting the icon in the menu XML and getting rid of the ImageView:

@Override
public View onCreateActionView(){
    return null;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics