我想有一个包含两个文本视图的框,一个标题和一个文本,长度可以长也可以不长。像这样:
<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9Gb0hYYS5wbmcifQ==” alt =“在此处输入链接描述”>
当前,我所拥有的是:如果文本太大,则将其移到标题上方。该框可以具有所需的任何布局(相对,约束...)...
有人知道该怎么做吗?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="title"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
tools:text="some very very very very very very very very long text"/>
</LinearLayout>