在inflate方法的源码可以看到

关于inflate出来的view的margin属性失效问题

也就是说 , 如果inflate方法中的root参数为null时 , 不会生成layoutparams , 所以margin会失效 , 所以在inflate方法把root参数绑定成你的parent即可

相关文章:

  • 2021-11-09
  • 2022-12-23
  • 2021-11-25
  • 2021-08-08
  • 2021-10-15
  • 2022-02-23
  • 2021-06-18
猜你喜欢
  • 2022-01-12
  • 2022-12-23
  • 2021-06-30
  • 2021-07-18
  • 2021-12-20
  • 2022-01-04
相关资源
相似解决方案