Strange behavior of inflated buttons when changing one's color

后端 未结 2 920
孤城傲影
孤城傲影 2021-01-15 12:18

I am trying to implement a dynamic button inflation for my Android application, based on an input specified by the user in real time. When clicked, button changes its color

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-15 13:09

    call invalidate on linear layout after adding the view,

    linearLayout.addView(buttonLayout);
    linearLayout.invalidate();
    

提交回复
热议问题