书上介绍说可以用权重android:weightSum对LinearLayout进行比例划分,但是不行啊。
比如LinearLayout上有三个textview,每个textview的android:layout_weight="1";
如果每个textview的text的内容长度是一致的,就可以等比划分,但是text的长度不一样就不行了啊。
比如LinearLayout上有三个textview,每个textview的android:layout_weight="1";
如果每个textview的text的内容长度是一致的,就可以等比划分,但是text的长度不一样就不行了啊。
android:layout_width="fill_parent"
android:layout_weight="1"
试试看
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="38dip"
android:background="#0000AA"
android:orientation="horizontal" > <TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:maxLines="1"
android:background="#FF0000"
android:hint="好好学习,天天向上"
android:singleLine="false" /> <TextView
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:background="#FFFF00"
android:text="无" /> <TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#F55F00"
android:text="无tryrd yui" /></LinearLayout>