Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/201.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android多个文本视图的布局和文本换行_Android_Textview_Android Linearlayout - Fatal编程技术网

android多个文本视图的布局和文本换行

android多个文本视图的布局和文本换行,android,textview,android-linearlayout,Android,Textview,Android Linearlayout,我有一个包含4个文本视图的水平线性布局。有时,其中一个文本视图中的文本很长,最后一个文本视图不能正确地显示在布局中。 当然,我可以设置一个文本视图,但这不是最优的,因为文本是从不同的位置设置的,并且具有不同的样式。 知道如何解决这个问题吗? 非常感谢。您可以使用权重在线性布局中以25%的比例分布视图 例如(未经测试,可能包含打字错误): <LinearLayout android:weightSum="100" android:layout_width="match_parent" a

我有一个包含4个文本视图的水平线性布局。有时,其中一个文本视图中的文本很长,最后一个文本视图不能正确地显示在布局中。
当然,我可以设置一个文本视图,但这不是最优的,因为文本是从不同的位置设置的,并且具有不同的样式。
知道如何解决这个问题吗?

非常感谢。

您可以使用权重在线性布局中以25%的比例分布视图

例如(未经测试,可能包含打字错误):


<LinearLayout android:weightSum="100" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal">
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView>
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView>
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView>
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView>
</LinearLayout>