Adding a linear layout to Navigation drawer (ends up crashing with a ClassCastException)

后端 未结 5 1481
遇见更好的自我
遇见更好的自我 2020-12-10 07:06

I am trying to add a vertical linear layout (having a title, image, menu title, listview and an icon at the bottom)to the navigation drawer. However the app crashes displayi

5条回答
  •  清歌不尽
    2020-12-10 07:27

    This error is coming because of wrong import. Add a proper import for Layout params.

    This import "android.widget.LinearLayout.LayoutParams" is getting mixed with Drawerlayout library declaration of LayoutParams ie "android.support.v4.widget.DrawerLayout$LayoutParams" resulting in ClassCast excption.

提交回复
热议问题