3

I'm new to this, I would say what is the difference between width = "fill_parent" and width = "wrap_content"?

Octahedron
  • 893
  • 2
  • 16
  • 31
Yost_RC
  • 31
  • 3

2 Answers2

1

fill_parent will make the width or height of the element to be as large as the parent element, in other words, the container.

wrap_content will make the width or height be as large as needed to contain the elements within it.

1

From android docs.-

FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), which
means that the view wants to be as big as its parent (minus padding)

WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content > (plus padding)

Community
  • 1
  • 1
ssantos
  • 16,001
  • 7
  • 50
  • 70