3

I have a RelativeLayout and i want it to fill the whole width of the view, but if it would become bigger than xx dip it should stay in this size. I tried to use android:maxWidth="xxdp" but it is not working with match_parent.

AdrianoCelentano
  • 2,461
  • 3
  • 31
  • 42

1 Answers1

-2

Rather than setting width to match_parent, set the width to "0dp" and the weight of the layout to 1.0f. Assuming there are no other views in the same parent, this should force the RelativeLayout to fill the width. maxWidth should now work like you expected.

JRad the Bad
  • 511
  • 5
  • 25