How to dynamically set layout parameters in Android?

后端 未结 2 1363
半阙折子戏
半阙折子戏 2021-02-08 01:04

I have these text fields which I generated dynamically. But I can\'t seem to set layout parameters for them. Please tell me what I\'m doing wrong.

I\'m able to generate

2条回答
  •  青春惊慌失措
    2021-02-08 01:52

    You are adding Table Row into table so use TableLayout.LayoutParams instead of LinearLayout.LayoutParams.As we use LayoutParam according to parent in which we are going to add

提交回复
热议问题