android dynamically add layouts under each other

前端 未结 2 2019
失恋的感觉
失恋的感觉 2021-01-07 01:38

I\'m trying to add multiple layouts dynamically under each other. So I wrote the following code:

   for (int i = 1; i <= layoutCounter; i++) {
        Vie         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-07 02:17

    Maybe with:

    params.addRule(RelativeLayout.BELOW, layoutID-1);

    instead of:

    params.addRule(RelativeLayout.BELOW, neu.getId());

    in your else condition.

提交回复
热议问题