android:java.lang.NoSuchMethodError: android.widget.PopupWindow.showAsDropDown

xiaoxiao2021-02-28  27

这个版本发生在android版本<16的时候,原来调用:public void showAsDropDown(View anchor, int xoff, int yoff, int gravity)要改为public void showAsDropDown(View anchor, int xoff, int yoff)。即去掉最后的gravity参数:

大致写法:

if (Build.VERSION.SDK_INT > 18) dialog.showAsDropDown(getSupportActionBar().getCustomView(), 500, 0, Gravity.END); else dialog.showAsDropDown(getSupportActionBar().getCustomView(), 500, 0);
转载请注明原文地址: https://www.6miu.com/read-1949963.html

最新回复(0)