android How to add view at start of layout?

后端 未结 3 1636
醉酒成梦
醉酒成梦 2020-12-11 14:43

My question is simple. I have a linearlayout. It has some child views. Now I want to add a view at the start of the child. Means in normal addView(view), the view s added at

3条回答
  •  一生所求
    2020-12-11 15:43

    Consider exploring the index argument of the addView method in parent class ViewGroup, Specifically addView(View child, ViewGroup.LayoutParams params). This method adds a View to the parent layout with the params defined, the index acts as a preference or rather point of insertion of the view in the layout.

提交回复
热议问题