Android 7.0 and above PopupWindow location will appear abnormal, background shading may also be abnormal, need to dynamically calculate the height.
//popupWindow 适配7.0及以上系统显示问题
if (Build.VERSION.SDK_INT >= 24) {
Rect rect = new Rect();
mTabLayout.getGlobalVisibleRect(rect);
int height = mTabLayout.getResources().getDisplayMetrics().heightPixels - rect.bottom;
popupWindow.setHeight(height);
}
popupWindow.showAsDropDown(mTabLayout, 0, 0);