How can I set the max width of my horizontal LinearLayout
? So if the contents are short (say, some text), the layout shrinks and if the contents are longer, it will not expand more than some max width value.
I prefer doing this at the XML level.
How can I set the max width of my horizontal LinearLayout
? So if the contents are short (say, some text), the layout shrinks and if the contents are longer, it will not expand more than some max width value.
I prefer doing this at the XML level.
This does it - what I needed beyond what was suggested in prior answer is to add another layout (
@+id/TheLayout
) as a wrapper between the content and the top layout: