【发布时间】:2016-09-04 11:12:42
【问题描述】:
我有一个带有表格行的表格视图,输出是这样的(背景 = 形状)
两个编辑文本具有相同的大小 - 但我希望第一个编辑文本从 ':' 开始填充该行的其余部分,第二个可能保持较短的 7 个字母。
有什么帮助吗?
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/BackGC"
>
<TableRow
android:orientation="horizontal"
android:layout_margin="5dp"
android:padding="3dp"
android:background="@drawable/editdef"
android:layout_width="match_parent"
>
<TextView
android:id="@+id/tView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tvname"
android:textSize="21sp"
android:textStyle="bold"
android:paddingLeft="5dp"
/>
<EditText
android:id="@+id/edName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/btnpress"
android:hint="@string/lname"
android:singleLine="true"
android:textColor="#999999"
android:textSize="21sp"
android:textStyle="bold"
/>
</TableRow>
<TableRow
android:orientation="horizontal"
android:layout_margin="5dp"
android:padding="3dp"
android:background="@drawable/editdef" >
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/tvlang"
android:textSize="21sp"
android:textStyle="bold"
android:paddingLeft="5dp"
/>
<EditText
android:id="@+id/edLang"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/edtbg"
android:hint="@string/lname"
android:singleLine="true"
android:textColor="#999999"
android:textSize="21sp"
android:textStyle="bold"
/>
</TableRow>
... </tablelayout>
【问题讨论】:
标签: android android-edittext width