Android floating view (over other views)

前端 未结 2 621
粉色の甜心
粉色の甜心 2020-12-28 16:12

I\'ve been messing around with this for a few days now, hopefully someone here can lend me a hand.

I have a simple two-column layout, the left side is a navigation b

相关标签:
2条回答
  • 2020-12-28 16:19

    A FrameLayout allows you to have a view overlapping another view. I'm not sure it makes sense to have them with only one child view, as you have in your example. Try having a FrameLayout at the highest level, with your "static" view as the first child element, and the floating menu as the second child.

    The developer documents have a good overview the layout types, it might help you get started.

    0 讨论(0)
  • 2020-12-28 16:23

    RelativeLayout is what you want.
    FrameLayout must only have one child, and is therefore, usually, only used for a placeholder where other layouts come later (such as the main frame of the activity).
    AbsoluteLayout is deprecated, and should not be used.

    RelativeLayout allows the views to overlap, and allows doing, pretty much, anything you want.

    0 讨论(0)
提交回复
热议问题