How to show one layout on top of the other programmatically in my case?

前端 未结 3 1214
清酒与你
清酒与你 2020-11-28 19:53

My main layout main.xml simply contains two LinearLayouts:

  • The 1st LinearLayout hosts a VideoView and a Button
3条回答
  •  生来不讨喜
    2020-11-28 20:57

    FrameLayout is not the better way to do this:

    Use RelativeLayout instead. You can position the elements anywhere you like. The element that comes after, has the higher z-index than the previous one (i.e. it comes over the previous one).

    Example:

    
    
        
    
        
    
    

提交回复
热议问题