RuntimeException: Binary XML file line #17: You must supply a layout_height attribute whie showing the popupmenu

后端 未结 4 372
遥遥无期
遥遥无期 2021-01-13 06:30
        public void showPopup(int group,int img_index,JSONArray json_ar,View v){

        PopupMenu pm=new PopupMenu(EditPhotosActivity.this,v);
        pm.getMenuIn         


        
4条回答
  •  醉酒成梦
    2021-01-13 07:20

    Make sure your have set right theme. android.support.v7.widget.PopupMenu expect the Application to have AppCompat theme, else it will throw exception when you try to show the PopupMenu

     android:theme="@style/Theme.AppCompat"
    

    But, android.widget.PopupMenu will work without this theme.

提交回复
热议问题