How to Programmatically Add Views to Views

后端 未结 7 797
春和景丽
春和景丽 2020-11-22 12:55

Let\'s say I have a LinearLayout, and I want to add a View to it, in my program from the Java code. What method is used for this? I\'m not asking how it\'s done

7条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 13:32

    You guys should also make sure that when you override onLayout you HAVE to call super.onLayout with all of the properties, or the view will not be inflated!

提交回复
热议问题