What does FrameLayout do?

前端 未结 5 1853
挽巷
挽巷 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:49

    Are you sure that you googled it?

    • http://www.tutorialspoint.com/android/android_frame_layout.htm

    Frame Layout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other.

    You can, however, add multiple children to a FrameLayout and control their position within the FrameLayout by assigning gravity to each child, using the android:layout_gravity attribute.

    • http://blog.neteril.org/blog/2013/10/10/framelayout-your-best-ui-friend/

    The secret of FrameLayout is how it layouts its children. Although normally designed to contain one item, it will happily stack up other element on top of each other. Thus FrameLayout is essentially a way to manipulate the Z-order of views on the screen.

    This is super useful for a couple of UI tricks from HUD-like elements to sliding panels to more complex animated transitions. In this post we will see an example for each of those.

    • http://www.learn-android-easily.com/2013/05/frame-layout-in-androis.html

    FrameLayout is designed to display a single item at a time. You can have multiple elements within a FrameLayout but each element will be positioned based on the top left of the screen. Elements that overlap will be displayed overlapping. I have created a simple XML layout using FrameLayout that shows how this works.

提交回复
热议问题