本文整理了Java中android.support.v7.widget.PopupMenu.setGravity()
方法的一些代码示例,展示了PopupMenu.setGravity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupMenu.setGravity()
方法的具体详情如下:
包路径:android.support.v7.widget.PopupMenu
类名称:PopupMenu
方法名:setGravity
暂无
代码示例来源:origin: mancj/MaterialSearchBar
private void inflateMenuRequest(int menuResource, int iconResId
) {
int menuResource1 = menuResource;
if (menuResource1 > 0) {
ImageView menuIcon = findViewById(R.id.mt_menu);
if (iconResId != -1) {
menuIconRes = iconResId;
menuIcon.setImageResource(menuIconRes);
}
RelativeLayout.LayoutParams params = (LayoutParams) searchIcon.getLayoutParams();
params.rightMargin = (int) (48 * destiny);
searchIcon.setLayoutParams(params);
menuIcon.setVisibility(VISIBLE);
menuIcon.setOnClickListener(this);
popupMenu = new PopupMenu(getContext(), menuIcon);
popupMenu.inflate(menuResource);
popupMenu.setGravity(Gravity.RIGHT);
}
}
代码示例来源:origin: w568w/fuckView
popupMenu.setGravity(Gravity.CENTER);
view.setBackgroundColor(Color.argb(120, 255, 0, 0));
updateLayout();
内容来源于网络,如有侵权,请联系作者删除!