我正在尝试使用片段中的溢出按钮显示弹出窗口。代码如下
@Override
public void onClick(View view) {
PopupMenu popup = new PopupMenu(context, view);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.menu_now_plying, popup.getMenu());
popup.show();
}
为什么它会折叠我的appbar布局?感谢帮助
答案 0 :(得分:0)
使用它:
PopupMenu popupMenu = new PopupMenu(context, view, Gravity.RIGHT);