<LinearLayout
android:layout_height = "wrap_content"
android:layout_width = "match_parent"
orientation="horizontal">
<ImageView/>
<TextView/
>
我正在自定义类中加载此布局。 我的问题取决于TextView的用户输入字符串长度,我想在Textview下方显示Button。如果String的长度足够小,以至于包括所有填充在内的所有三个控件都可以放在一行中,则在一行中显示,否则将按钮放在TextView + Image下方。