Android7.0 popupwindow showAsDropDown 无效解决方法

匿名 (未验证) 提交于 2019-12-03 00:34:01

试了网上查看的很多方法。。

就这个生效了。

if (Build.VERSION.SDK_INT < 24) {     popupwindow.showAsDropDown(mToolbar); } else {     Rect visibleFrame = new Rect();     mToolbar.getGlobalVisibleRect(visibleFrame);     int height = mToolbar.getResources().getDisplayMetrics().heightPixels - visibleFrame.bottom;     popupwindow.setHeight(height);     popupwindow.showAsDropDown(mToolbar, 0, 0); }

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!