I would like to have a horizontal LinearLayout
that is as wide as the screen and as high as its children, but the trick is that its children will have dynamic width each and I don't want them going off screen (cut out). I want them to flow/break in a new line so that they are all visible.
Although totally irrelevant to Android, it should work similar to how inline <div>
's work in HTML.
Here's what I have right now:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="If you would enter some digits in this field " />
<EditText
android:id="@+id/tvDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="enter some digits here"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" that would be great" />
</LinearLayout>
But as soon as the children of the LinearLayout
get wider than the screen the extra part gets off the screen/invisible.
ChipGroup
. It is meant to holdChip
but it is not limited to that. It can be a container for other views as well.ChipGroup
has the feature to overflow its views to the next line if they are not fitting in one line. – Sacksen