Android RelativeLayout — how to position?

后端 未结 3 1255
旧时难觅i
旧时难觅i 2021-02-14 14:03

I want a Layout like this: \"Desired

But my code doesn\'t work. I can\'t achieve this Layout, and I don\'t

相关标签:
3条回答
  • 2021-02-14 14:40

    Only when it comes to a Relative layout, you can switch to the Graphical layout in your Eclipse editor and drag and set the attributes. Everything with just your mouse. This however isn't possible with any other layout. Hope that helps.

    0 讨论(0)
  • 2021-02-14 14:45

    You don't need to use gravity or the inner LinearLayout at all for this. Instead use layout_alignParentTop, layout_alignParentLeft, layout_alignParentRight, layout_alignParentBottom, layout_centerInParent and layout_centerVertical on the children.

    It might be useful for you to go through the RelativeLayout tutorial.

    0 讨论(0)
  • 2021-02-14 14:48

    RelativeLayout is a ViewGroup that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left or center).

    Official Android Developer Click.

    RelativeLayout Video link.

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