4

TableRow で EditText ビューを使用しても解決できない小さなクリッピングの問題があります。何を試しても、EditText ビューが切り取られるか (添付のスクリーンショット)、shrinkColumns を 0 または 1 に設定すると、ラベル テキストが消えます (EditText ビューが幅全体を占めます)。レイアウトは次のとおりです。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:padding="10dip">

  <TableLayout android:orientation="vertical"
  android:layout_width="fill_parent" android:layout_height="fill_parent">

    <TableRow android:orientation="horizontal"
    android:layout_width="fill_parent" android:layout_height="wrap_content">

      <TextView android:paddingRight="10dip" android:layout_column="1"
      android:text="Label Text" />
      <EditText android:text="Very long text that makes the text view go on clipping frenzy"
      android:layout_width="wrap_content" android:layout_height="wrap_content" />

    </TableRow>

  </TableLayout>

</LinearLayout>

QVGA と HVGA で動作する 2.2 エミュレータ、2.1 の HTC Hero、2.1 の Wildfire でも試しました。また、私の場合は役に立たないように見える clipToPadding 属性をいじりました。ヒント属性に長いテキストを設定し、テキスト値を空のままにすると、同じ問題が発生します。

特に複雑なことは何もしていないので、単純なエラーが疑われます。アイデア、ヒント、提案は大歓迎です。

乾杯!

代替テキスト

4

2 に答える 2

7

TableLayout で android:shrinkColumns="1" を設定し、TextView から android:layout_column="1" を削除します。

于 2010-11-15T12:33:38.840 に答える
1

android:layout_weight="1" を EditText に追加します。解決するのに時間がかかりました........

しかし、その理由はわかりません........

于 2010-11-15T12:35:23.637 に答える