FrameLayout to RelativeLayout ClassCastException even if there is no FrameLayout used

前端 未结 3 1093
萌比男神i
萌比男神i 2021-01-04 00:59

In my application, I have a layout which has a RelativeLayout to which I want to set margins at runtime programmatically. But when I do that, it gives me

3条回答
  •  盖世英雄少女心
    2021-01-04 01:34

    I suggest that the parent of the @id/rl_root must be FrameLayout which is not showing in this xml. LayoutParam's type should be the same with its parent not itself.

提交回复
热议问题