我在我的线性布局
中有四个TextViews
,它们的宽度相等,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView86" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.25"
android:layout_height="wrap_content" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.25"
android:layout_height="wrap_content" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.25"
android:layout_height="wrap_content" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.25"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
我的问题是,TextView应该显示相同的高度。文本内容将通过编程方式设置。我尝试使用RelativeLayout,但TextView的宽度不能相同。我需要最高子项的高度和宽度都相同。请指导我。谢谢!