change order of views in linear layout android

后端 未结 2 601
时光说笑
时光说笑 2020-11-30 13:33

As you know the order of views in linear layout is related to the order of them in xml file. Is it possible to change that order with java code by something like indexing?

2条回答
  •  心在旅途
    2020-11-30 14:05

    I would try to remove all views with removeView(view) and add them with addView(childView, index) in that order you like.

提交回复
热议问题