What does FrameLayout do?

前端 未结 5 1865
挽巷
挽巷 2020-12-07 15:28

I\'m new to programming. I was using Graphical Layout then when I was reading xml file, I saw FrameLayout. Then I searched, but I couldn\'t find something useful. What is Fr

5条回答
  •  不知归路
    2020-12-07 15:55

    FrameLayout is the simplest implementation of ViewGroup. Child views are drawn are in a stack, where the latest added view is drawn at the top. Usually you can use one of the next approaches or combine them:

    1. Add a single view hierarchy into FrameLayout
    2. Add multiple children and use android:layout_gravity to navigate them

    Another popular approaches of using FrameLayout:

    • as a Fragment container
    • as an ancestor of your custom ViewGroup

提交回复
热议问题