Placing/Overlapping(z-index) a view above another view in android

前端 未结 11 1737
遥遥无期
遥遥无期 2020-11-22 17:07

I have a linear layout which consists of imageview and textview , one below another in a linear layout.



        
11条回答
  •  遥遥无期
    2020-11-22 17:49

    I use this, if you want only one view to be bring to front when needed:

    containerView.bringChildToFront(topView);
    

    containerView is container of views to be sorted, topView is view which i want to have as top most in container.

    for multiple views to arrange is about to use setChildrenDrawingOrderEnabled(true) and overriding getChildDrawingOrder(int childCount, int i) as mentioned above.

提交回复
热议问题