我有这样的布局,硬编码的宽度:Android - 3列行布局 - 如何让它占用屏幕的百分比?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="4dip"
android:paddingBottom="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:weightSum="1.0">
<TextView android:id="@+id/TRAIN_CELL"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".60"/>
<TextView android:id="@+id/FROM_CELL"
android:layout_width="0dp"
android:textSize="20sp"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/light_best_blue"
android:layout_height="wrap_content"
android:layout_weight=".20"/>
<TextView android:id="@+id/TO_CELL"
android:layout_width="0dp"
android:textSize="20sp"
android:textStyle="bold"
android:gravity="center"
android:layout_weight=".20"
android:textColor="@color/light_best_blue"
android:layout_height="wrap_content" />
</LinearLayout>
但是,有没有办法给每列的宽度的百分比?
谢谢!
我想这也不太工作的一些不同的东西。我在最初的问题中发布了我的最新版式。你能注意到那里可能不是那个地方吗?谢谢! – Genadinik
没有什么似乎。也许使用0.20而不是.20,或甚至使用整数(60,20,20) – njzk2